.686p
.mmx
.model flat, c
option casemap :none

include main_type.inc
include main_data.inc
include main74_1.inc
include main74_2.inc
include main74_3.inc
include main74_4.inc
include main74_5.inc
include main74_6.inc
include main74_7.inc
include main74_8.inc
include main74_9.inc
include main74_11.inc

.code
; =============== S U B	R O U T	I N E =======================================


sub_459410 proc	near			; CODE XREF: sub_4592C0+6Cp
					; sub_4592C0+97p

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

push	ebx
push	ebp
push	esi
mov	esi, [esp+0Ch+arg_4]
push	edi
xor	edi, edi
mov	ebx, [esi+8]
mov	eax, [esi+10h]
shl	ebx, 7
mov	ebp, ebx
mov	[esp+10h+arg_4], ebx
imul	ebp, [esi+18h]
test	eax, eax
jle	short loc_4594AA
jmp	short loc_459437
; ---------------------------------------------------------------------------

loc_459433:				; CODE XREF: sub_459410+98j
mov	ebx, [esp+10h+arg_4]

loc_459437:				; CODE XREF: sub_459410+21j
mov	ecx, [esi+14h]
sub	eax, edi
cmp	ecx, eax
jge	short loc_459442
mov	eax, ecx

loc_459442:				; CODE XREF: sub_459410+2Ej
mov	edx, [esi+18h]
mov	ecx, edi
add	ecx, edx
mov	edx, [esi+1Ch]
sub	edx, ecx
cmp	eax, edx
jl	short loc_459454
mov	eax, edx

loc_459454:				; CODE XREF: sub_459410+40j
mov	edx, [esi+4]
sub	edx, ecx
cmp	eax, edx
jl	short loc_45945F
mov	eax, edx

loc_45945F:				; CODE XREF: sub_459410+4Bj
test	eax, eax
jle	short loc_4594AA
imul	eax, ebx
mov	ebx, eax
mov	eax, [esp+10h+arg_8]
test	eax, eax
jz	short loc_459486
mov	eax, [esi]
push	ebx
push	ebp
lea	edx, [esi+30h]
mov	ecx, [eax+edi*4]
mov	eax, [esp+18h+arg_0]
push	ecx
push	edx
push	eax
call	dword ptr [esi+34h]
jmp	short loc_459499
; ---------------------------------------------------------------------------

loc_459486:				; CODE XREF: sub_459410+5Ej
mov	ecx, [esi]
push	ebx
lea	eax, [esi+30h]
push	ebp
mov	edx, [ecx+edi*4]
mov	ecx, [esp+18h+arg_0]
push	edx
push	eax
push	ecx
call	dword ptr [eax]

loc_459499:				; CODE XREF: sub_459410+74j
mov	edx, [esi+14h]
mov	eax, [esi+10h]
add	edi, edx
add	esp, 14h
add	ebp, ebx
cmp	edi, eax
jl	short loc_459433

loc_4594AA:				; CODE XREF: sub_459410+1Fj
					; sub_459410+51j
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
sub_459410 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_4594B0 proc	near			; CODE XREF: sub_4595B0+Dp
					; DATA XREF: sub_4589C0+82o

arg_0= dword ptr  4
arg_4= dword ptr  8

push	ebx
push	ebp
mov	ebp, [esp+8+arg_0]
push	esi
push	edi
mov	edi, [esp+10h+arg_4]
mov	esi, [ebp+4]
xor	ebx, ebx
cmp	edi, ebx
jl	short loc_4594CA
cmp	edi, 2
jl	short loc_4594E3

loc_4594CA:				; CODE XREF: sub_4594B0+13j
mov	eax, [ebp+0]
push	ebp
mov	dword ptr [eax+14h], 0Eh
mov	ecx, [ebp+0]
mov	[ecx+18h], edi
mov	edx, [ebp+0]
call	dword ptr [edx]
add	esp, 4

loc_4594E3:				; CODE XREF: sub_4594B0+18j
cmp	edi, 1
jnz	short loc_459534
mov	edi, [esi+44h]
cmp	edi, ebx
jz	short loc_459509

loc_4594EF:				; CODE XREF: sub_4594B0+57j
cmp	[edi+28h], ebx
jz	short loc_459502
lea	eax, [edi+30h]
mov	[edi+28h], ebx
push	eax
push	ebp
call	dword ptr [edi+38h]
add	esp, 8

loc_459502:				; CODE XREF: sub_4594B0+42j
mov	edi, [edi+2Ch]
cmp	edi, ebx
jnz	short loc_4594EF

loc_459509:				; CODE XREF: sub_4594B0+3Dj
mov	edi, [esi+48h]
mov	[esi+44h], ebx
cmp	edi, ebx
jz	short loc_45952D

loc_459513:				; CODE XREF: sub_4594B0+7Bj
cmp	[edi+28h], ebx
jz	short loc_459526
lea	ecx, [edi+30h]
mov	[edi+28h], ebx
push	ecx
push	ebp
call	dword ptr [edi+38h]
add	esp, 8

loc_459526:				; CODE XREF: sub_4594B0+66j
mov	edi, [edi+2Ch]
cmp	edi, ebx
jnz	short loc_459513

loc_45952D:				; CODE XREF: sub_4594B0+61j
mov	edi, [esp+10h+arg_4]
mov	[esi+48h], ebx

loc_459534:				; CODE XREF: sub_4594B0+36j
mov	eax, [esi+edi*4+3Ch]
mov	[esi+edi*4+3Ch], ebx
cmp	eax, ebx
jz	short loc_45956B

loc_459540:				; CODE XREF: sub_4594B0+B3j
mov	edx, [eax+8]
mov	ecx, [eax+4]
mov	edi, [eax]
lea	ebx, [edx+ecx+10h]
push	ebx
push	eax				; void *
push	ebp				; int
call	sub_45CC70
mov	edx, [esi+4Ch]
add	esp, 0Ch
sub	edx, ebx
mov	eax, edi
test	edi, edi
mov	[esi+4Ch], edx
jnz	short loc_459540
mov	edi, [esp+10h+arg_4]
xor	ebx, ebx

loc_45956B:				; CODE XREF: sub_4594B0+8Ej
mov	eax, [esi+edi*4+34h]
mov	[esi+edi*4+34h], ebx
cmp	eax, ebx
jz	short loc_45959C

loc_459577:				; CODE XREF: sub_4594B0+EAj
mov	edx, [eax+8]
mov	ecx, [eax+4]
mov	edi, [eax]
lea	ebx, [edx+ecx+10h]
push	ebx
push	eax				; void *
push	ebp				; int
call	sub_45CC50
mov	edx, [esi+4Ch]
add	esp, 0Ch
sub	edx, ebx
mov	eax, edi
test	edi, edi
mov	[esi+4Ch], edx
jnz	short loc_459577

loc_45959C:				; CODE XREF: sub_4594B0+C5j
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
sub_4594B0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_4595B0 proc	near			; DATA XREF: sub_4589C0+89o

arg_0= dword ptr  4

push	esi
push	edi
mov	edi, [esp+8+arg_0]
mov	esi, 1

loc_4595BB:				; CODE XREF: sub_4595B0+16j
push	esi
push	edi
call	sub_4594B0
add	esp, 8
dec	esi
jns	short loc_4595BB
mov	eax, [edi+4]
push	54h
push	eax				; void *
push	edi				; int
call	sub_45CC50
push	edi
mov	dword ptr [edi+4], 0
call	nullsub_5
add	esp, 10h
pop	edi
pop	esi
retn
sub_4595B0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_4595F0 proc	near			; CODE XREF: .text:00456DB5p
					; sub_456E10+F8p ...

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
mov	eax, [esi+4]
test	eax, eax
jz	short loc_459626
push	1
push	esi
call	dword ptr [eax+24h]
mov	eax, [esi+10h]
add	esp, 8
test	eax, eax
jz	short loc_45961F
mov	dword ptr [esi+14h], 0C8h
mov	dword ptr [esi+130h], 0
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45961F:				; CODE XREF: sub_4595F0+1Aj
mov	dword ptr [esi+14h], 64h

loc_459626:				; CODE XREF: sub_4595F0+Aj
pop	esi
retn
sub_4595F0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_459630 proc	near			; CODE XREF: sub_456DA0+5p
					; sub_457DB0+Cp ...

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	edi
xor	edi, edi
mov	eax, [esi+4]
cmp	eax, edi
jz	short loc_459646
push	esi
call	dword ptr [eax+28h]
add	esp, 4

loc_459646:				; CODE XREF: sub_459630+Dj
mov	[esi+4], edi
mov	[esi+14h], edi
pop	edi
pop	esi
retn
sub_459630 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_459650 proc	near			; CODE XREF: sub_457290+55p
					; sub_45BC30+DDp

arg_0= dword ptr  4

mov	eax, [esp+arg_0]
push	84h
push	0
push	eax
mov	ecx, [eax+4]
call	dword ptr [ecx]
add	esp, 0Ch
mov	dword ptr [eax+80h], 0
retn
sub_459650 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_459670 proc	near			; CODE XREF: sub_457570+13p
					; sub_45B8C0+2D9p ...

arg_0= dword ptr  4

mov	eax, [esp+arg_0]
push	118h
push	0
push	eax
mov	ecx, [eax+4]
call	dword ptr [ecx]
add	esp, 0Ch
mov	dword ptr [eax+114h], 0
retn
sub_459670 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_459690 proc	near			; CODE XREF: .text:00457052p
					; sub_459F80+9Cp

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	20h
push	1
mov	eax, [esi+4]
push	esi
call	dword ptr [eax]
add	esp, 0Ch
mov	[esi+15Ch], eax
mov	dword ptr [eax], offset	sub_4597E0
mov	dword ptr [eax+4], offset sub_459980
mov	dword ptr [eax+8], offset sub_459C20
mov	dword ptr [eax+0Ch], offset loc_459EE0
mov	dword ptr [eax+10h], offset sub_459F00
mov	dword ptr [eax+14h], offset sub_4596F0
mov	dword ptr [eax+18h], offset sub_4597C0
mov	dword ptr [eax+1Ch], 0
pop	esi
retn
sub_459690 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_4596F0 proc	near			; DATA XREF: sub_459690+3Ao

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

push	esi
mov	esi, [esp+4+arg_0]
push	edi
mov	edi, [esp+8+arg_8]
cmp	edi, 0FFFDh
jbe	short loc_459713
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 0Bh
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4

loc_459713:				; CODE XREF: sub_4596F0+10j
mov	edx, [esp+8+arg_4]
push	edx
push	esi
call	sub_459730
add	edi, 2
push	edi
push	esi
call	sub_459790
add	esp, 10h
pop	edi
pop	esi
retn
sub_4596F0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_459730 proc	near			; CODE XREF: sub_4596F0+29p
					; sub_4597E0+12p ...

arg_0= dword ptr  4
arg_4= dword ptr  8

push	esi
mov	esi, [esp+4+arg_0]
push	0FFh
push	esi
call	sub_459750
mov	eax, [esp+0Ch+arg_4]
push	eax
push	esi
call	sub_459750
add	esp, 10h
pop	esi
retn
sub_459730 endp


; =============== S U B	R O U T	I N E =======================================


sub_459750 proc	near			; CODE XREF: sub_459730+Bp
					; sub_459730+16p ...

arg_0= dword ptr  4
arg_4= byte ptr	 8

push	esi
mov	esi, [esp+4+arg_0]
mov	dl, [esp+4+arg_4]
mov	eax, [esi+18h]
mov	ecx, [eax]
mov	[ecx], dl
mov	edx, [eax]
mov	ecx, [eax+4]
inc	edx
dec	ecx
mov	[eax], edx
mov	[eax+4], ecx
jnz	short loc_45978A
push	esi
call	dword ptr [eax+0Ch]
add	esp, 4
test	eax, eax
jnz	short loc_45978A
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 18h
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4

loc_45978A:				; CODE XREF: sub_459750+1Cj
					; sub_459750+27j
pop	esi
retn
sub_459750 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_459790 proc	near			; CODE XREF: sub_4596F0+33p
					; sub_459830+13p ...

arg_0= dword ptr  4
arg_4= dword ptr  8

push	ebx
mov	ebx, [esp+4+arg_4]
xor	eax, eax
push	esi
mov	esi, [esp+8+arg_0]
mov	al, bh
push	eax
push	esi
call	sub_459750
and	ebx, 0FFh
push	ebx
push	esi
call	sub_459750
add	esp, 10h
pop	esi
pop	ebx
retn
sub_459790 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_4597C0 proc	near			; DATA XREF: sub_459690+41o

arg_0= dword ptr  4
arg_4= dword ptr  8

mov	eax, [esp+arg_4]
mov	ecx, [esp+arg_0]
push	eax
push	ecx
call	sub_459750
add	esp, 8
retn
sub_4597C0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_4597E0 proc	near			; DATA XREF: sub_459690+18o

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	edi
push	0D8h
mov	edi, [esi+15Ch]
push	esi
call	sub_459730
mov	dword ptr [edi+1Ch], 0
mov	eax, [esi+0D0h]
add	esp, 8
test	eax, eax
jz	short loc_459814
push	esi
call	sub_459830
add	esp, 4

loc_459814:				; CODE XREF: sub_4597E0+29j
mov	eax, [esi+0DCh]
test	eax, eax
jz	short loc_459827
push	esi
call	sub_4598E0
add	esp, 4

loc_459827:				; CODE XREF: sub_4597E0+3Cj
pop	edi
pop	esi
retn
sub_4597E0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_459830 proc	near			; CODE XREF: sub_4597E0+2Cp

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	0E0h
push	esi
call	sub_459730
push	10h
push	esi
call	sub_459790
push	4Ah
push	esi
call	sub_459750
push	46h
push	esi
call	sub_459750
push	49h
push	esi
call	sub_459750
push	46h
push	esi
call	sub_459750
push	0
push	esi
call	sub_459750
xor	eax, eax
mov	al, [esi+0D4h]
push	eax
push	esi
call	sub_459750
xor	ecx, ecx
add	esp, 40h
mov	cl, [esi+0D5h]
push	ecx
push	esi
call	sub_459750
xor	edx, edx
mov	dl, [esi+0D6h]
push	edx
push	esi
call	sub_459750
xor	eax, eax
mov	ax, [esi+0D8h]
push	eax
push	esi
call	sub_459790
xor	ecx, ecx
mov	cx, [esi+0DAh]
push	ecx
push	esi
call	sub_459790
push	0
push	esi
call	sub_459750
push	0
push	esi
call	sub_459750
add	esp, 30h
pop	esi
retn
sub_459830 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_4598E0 proc	near			; CODE XREF: sub_4597E0+3Fp

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	0EEh
push	esi
call	sub_459730
push	0Eh
push	esi
call	sub_459790
push	41h
push	esi
call	sub_459750
push	64h
push	esi
call	sub_459750
push	6Fh
push	esi
call	sub_459750
push	62h
push	esi
call	sub_459750
push	65h
push	esi
call	sub_459750
push	64h
push	esi
call	sub_459790
add	esp, 40h
push	0
push	esi
call	sub_459790
push	0
push	esi
call	sub_459790
mov	eax, [esi+40h]
add	esp, 10h
sub	eax, 3
jz	short loc_459965
sub	eax, 2
jz	short loc_459958
push	0
push	esi
call	sub_459750
add	esp, 8
pop	esi
retn
; ---------------------------------------------------------------------------

loc_459958:				; CODE XREF: sub_4598E0+69j
push	2
push	esi
call	sub_459750
add	esp, 8
pop	esi
retn
; ---------------------------------------------------------------------------

loc_459965:				; CODE XREF: sub_4598E0+64j
push	1
push	esi
call	sub_459750
add	esp, 8
pop	esi
retn
sub_4598E0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_459980 proc	near			; DATA XREF: sub_459690+1Eo

arg_0= dword ptr  4

push	ebx
push	ebp
push	esi
mov	esi, [esp+0Ch+arg_0]
push	edi
xor	ebp, ebp
mov	ecx, [esi+3Ch]
mov	eax, [esi+44h]
xor	edi, edi
test	ecx, ecx
jle	short loc_4599B2
lea	ebx, [eax+10h]

loc_459999:				; CODE XREF: sub_459980+30j
mov	eax, [ebx]
push	eax
push	esi
call	sub_459A80
add	esp, 8
add	ebp, eax
mov	eax, [esi+3Ch]
inc	edi
add	ebx, 54h
cmp	edi, eax
jl	short loc_459999

loc_4599B2:				; CODE XREF: sub_459980+14j
mov	eax, [esi+0B4h]
test	eax, eax
jnz	short loc_459A10
mov	eax, [esi+0E4h]
test	eax, eax
jnz	short loc_459A10
cmp	dword ptr [esi+38h], 8
jnz	short loc_459A10
mov	ecx, [esi+3Ch]
mov	eax, [esi+44h]
mov	edx, 1
test	ecx, ecx
mov	edi, edx
jle	short loc_4599F1
add	eax, 18h

loc_4599E0:				; CODE XREF: sub_459980+6Fj
cmp	[eax-4], edx
jg	short loc_4599E9
cmp	[eax], edx
jle	short loc_4599EB

loc_4599E9:				; CODE XREF: sub_459980+63j
xor	edi, edi

loc_4599EB:				; CODE XREF: sub_459980+67j
add	eax, 54h
dec	ecx
jnz	short loc_4599E0

loc_4599F1:				; CODE XREF: sub_459980+5Bj
test	ebp, ebp
jz	short loc_459A12
test	edi, edi
jz	short loc_459A12
mov	ecx, [esi]
xor	edi, edi
push	edi
push	esi
mov	dword ptr [ecx+14h], 4Bh
mov	edx, [esi]
call	dword ptr [edx+4]
add	esp, 8
jmp	short loc_459A12
; ---------------------------------------------------------------------------

loc_459A10:				; CODE XREF: sub_459980+3Aj
					; sub_459980+44j ...
xor	edi, edi

loc_459A12:				; CODE XREF: sub_459980+73j
					; sub_459980+77j ...
mov	eax, [esi+0B4h]
test	eax, eax
jz	short loc_459A2F
push	0C9h
push	esi
call	sub_459B60
add	esp, 8
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_459A2F:				; CODE XREF: sub_459980+9Aj
mov	eax, [esi+0E4h]
test	eax, eax
jz	short loc_459A4C
push	0C2h
push	esi
call	sub_459B60
add	esp, 8
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_459A4C:				; CODE XREF: sub_459980+B7j
test	edi, edi
jz	short loc_459A63
push	0C0h
push	esi
call	sub_459B60
add	esp, 8
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_459A63:				; CODE XREF: sub_459980+CEj
push	0C1h
push	esi
call	sub_459B60
add	esp, 8
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
sub_459980 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_459A80 proc	near			; CODE XREF: sub_459980+1Dp
					; sub_459F00+21p

arg_0= dword ptr  4
arg_4= dword ptr  8

push	ebx
mov	ebx, [esp+4+arg_0]
push	ebp
push	esi
push	edi
mov	edi, [esp+10h+arg_4]
mov	esi, [ebx+edi*4+48h]
test	esi, esi
mov	[esp+10h+arg_0], esi
jnz	short loc_459AAE
mov	eax, [ebx]
push	ebx
mov	dword ptr [eax+14h], 34h
mov	ecx, [ebx]
mov	[ecx+18h], edi
mov	edx, [ebx]
call	dword ptr [edx]
add	esp, 4

loc_459AAE:				; CODE XREF: sub_459A80+16j
xor	ebp, ebp
mov	eax, esi
mov	ecx, 40h

loc_459AB7:				; CODE XREF: sub_459A80+47j
cmp	word ptr [eax],	0FFh
jbe	short loc_459AC3
mov	ebp, 1

loc_459AC3:				; CODE XREF: sub_459A80+3Cj
add	eax, 2
dec	ecx
jnz	short loc_459AB7
mov	eax, [esi+80h]
test	eax, eax
jnz	short loc_459B4F
push	0DBh
push	ebx
call	sub_459730
mov	eax, ebp
neg	eax
sbb	eax, eax
and	eax, 40h
add	eax, 43h
push	eax
push	ebx
call	sub_459790
mov	ecx, ebp
shl	ecx, 4
add	ecx, edi
push	ecx
push	ebx
call	sub_459750
add	esp, 18h
mov	edi, offset dword_479024

loc_459B07:				; CODE XREF: sub_459A80+BFj
mov	edx, [edi]
mov	eax, [esp+10h+arg_0]
xor	esi, esi
mov	si, [eax+edx*2]
test	ebp, ebp
jz	short loc_459B26
mov	ecx, esi
shr	ecx, 8
push	ecx
push	ebx
call	sub_459750
add	esp, 8

loc_459B26:				; CODE XREF: sub_459A80+95j
and	esi, 0FFh
push	esi
push	ebx
call	sub_459750
add	edi, 4
add	esp, 8
cmp	edi, (offset dword_479024+100h)
jl	short loc_459B07
mov	edx, [esp+10h+arg_0]
mov	dword ptr [edx+80h], 1

loc_459B4F:				; CODE XREF: sub_459A80+51j
pop	edi
mov	eax, ebp
pop	esi
pop	ebp
pop	ebx
retn
sub_459A80 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_459B60 proc	near			; CODE XREF: sub_459980+A2p
					; sub_459980+BFp ...

arg_0= dword ptr  4
arg_4= dword ptr  8

mov	eax, [esp+arg_4]
push	ebx
push	esi
mov	esi, [esp+8+arg_0]
push	edi
push	eax
push	esi
call	sub_459730
mov	eax, [esi+3Ch]
lea	ecx, [eax+eax*2+8]
push	ecx
push	esi
call	sub_459790
mov	ecx, [esi+20h]
mov	eax, 0FFFFh
add	esp, 10h
cmp	ecx, eax
jg	short loc_459B94
cmp	[esi+1Ch], eax
jle	short loc_459BAA

loc_459B94:				; CODE XREF: sub_459B60+2Dj
mov	edx, [esi]
push	esi
mov	dword ptr [edx+14h], 29h
mov	ecx, [esi]
mov	[ecx+18h], eax
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4

loc_459BAA:				; CODE XREF: sub_459B60+32j
mov	eax, [esi+38h]
push	eax
push	esi
call	sub_459750
mov	ecx, [esi+20h]
push	ecx
push	esi
call	sub_459790
mov	edx, [esi+1Ch]
push	edx
push	esi
call	sub_459790
mov	eax, [esi+3Ch]
push	eax
push	esi
call	sub_459750
mov	eax, [esi+3Ch]
mov	edi, [esi+44h]
add	esp, 20h
xor	ebx, ebx
test	eax, eax
jle	short loc_459C14

loc_459BE1:				; CODE XREF: sub_459B60+B2j
mov	ecx, [edi]
push	ecx
push	esi
call	sub_459750
mov	edx, [edi+8]
mov	ecx, [edi+0Ch]
shl	edx, 4
add	edx, ecx
push	edx
push	esi
call	sub_459750
mov	eax, [edi+10h]
push	eax
push	esi
call	sub_459750
mov	eax, [esi+3Ch]
add	esp, 18h
inc	ebx
add	edi, 54h
cmp	ebx, eax
jl	short loc_459BE1

loc_459C14:				; CODE XREF: sub_459B60+7Fj
pop	edi
pop	esi
pop	ebx
retn
sub_459B60 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_459C20 proc	near			; DATA XREF: sub_459690+25o

arg_0= dword ptr  4

push	ebp
push	esi
mov	esi, [esp+8+arg_0]
push	edi
mov	eax, [esi+0B4h]
mov	edi, [esi+15Ch]
test	eax, eax
mov	[esp+0Ch+arg_0], edi
jz	short loc_459C49
push	esi
call	nullsub_4
add	esp, 4
jmp	loc_459CCC
; ---------------------------------------------------------------------------

loc_459C49:				; CODE XREF: sub_459C20+19j
mov	eax, [esi+0F4h]
xor	ebp, ebp
test	eax, eax
jle	short loc_459CCC
push	ebx
lea	ebx, [esi+0F8h]

loc_459C5C:				; CODE XREF: sub_459C20+A5j
mov	eax, [esi+0E4h]
mov	edi, [ebx]
test	eax, eax
jz	short loc_459C9E
mov	eax, [esi+13Ch]
test	eax, eax
jnz	short loc_459C8D
mov	eax, [esi+144h]
test	eax, eax
jnz	short loc_459CB9
mov	eax, [edi+14h]
push	0
push	eax
push	esi
call	sub_459D00
add	esp, 0Ch
jmp	short loc_459CB9
; ---------------------------------------------------------------------------

loc_459C8D:				; CODE XREF: sub_459C20+50j
mov	ecx, [edi+18h]
push	1
push	ecx
push	esi
call	sub_459D00
add	esp, 0Ch
jmp	short loc_459CB9
; ---------------------------------------------------------------------------

loc_459C9E:				; CODE XREF: sub_459C20+46j
mov	edx, [edi+14h]
push	0
push	edx
push	esi
call	sub_459D00
mov	eax, [edi+18h]
push	1
push	eax
push	esi
call	sub_459D00
add	esp, 18h

loc_459CB9:				; CODE XREF: sub_459C20+5Aj
					; sub_459C20+6Bj ...
mov	eax, [esi+0F4h]
inc	ebp
add	ebx, 4
cmp	ebp, eax
jl	short loc_459C5C
mov	edi, [esp+10h+arg_0]
pop	ebx

loc_459CCC:				; CODE XREF: sub_459C20+24j
					; sub_459C20+33j
mov	ecx, [esi+0C8h]
mov	eax, [edi+1Ch]
cmp	ecx, eax
jz	short loc_459CEB
push	esi
call	sub_459DD0
mov	edx, [esi+0C8h]
add	esp, 4
mov	[edi+1Ch], edx

loc_459CEB:				; CODE XREF: sub_459C20+B7j
push	esi
call	sub_459E00
add	esp, 4
pop	edi
pop	esi
pop	ebp
retn
sub_459C20 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_459D00 proc	near			; CODE XREF: sub_459C20+63p
					; sub_459C20+74p ...

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

mov	eax, [esp+arg_8]
push	ebx
mov	ebx, [esp+4+arg_4]
push	esi
mov	esi, [esp+8+arg_0]
push	edi
test	eax, eax
jz	short loc_459D1C
mov	edi, [esi+ebx*4+68h]
add	ebx, 10h
jmp	short loc_459D20
; ---------------------------------------------------------------------------

loc_459D1C:				; CODE XREF: sub_459D00+11j
mov	edi, [esi+ebx*4+58h]

loc_459D20:				; CODE XREF: sub_459D00+1Aj
test	edi, edi
jnz	short loc_459D3A
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 32h
mov	ecx, [esi]
mov	[ecx+18h], ebx
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4

loc_459D3A:				; CODE XREF: sub_459D00+22j
mov	eax, [edi+114h]
test	eax, eax
jnz	short loc_459DBB
push	ebp
push	0C4h
push	esi
call	sub_459730
add	esp, 8
xor	ebp, ebp
mov	eax, 1

loc_459D5A:				; CODE XREF: sub_459D00+65j
xor	ecx, ecx
mov	cl, [eax+edi]
add	ebp, ecx
inc	eax
cmp	eax, 10h
jle	short loc_459D5A
lea	edx, [ebp+13h]
push	edx
push	esi
call	sub_459790
push	ebx
push	esi
call	sub_459750
add	esp, 10h
mov	ebx, 1

loc_459D80:				; CODE XREF: sub_459D00+93j
xor	eax, eax
mov	al, [ebx+edi]
push	eax
push	esi
call	sub_459750
add	esp, 8
inc	ebx
cmp	ebx, 10h
jle	short loc_459D80
xor	ebx, ebx
test	ebp, ebp
jle	short loc_459DB0

loc_459D9B:				; CODE XREF: sub_459D00+AEj
xor	ecx, ecx
mov	cl, [edi+ebx+11h]
push	ecx
push	esi
call	sub_459750
add	esp, 8
inc	ebx
cmp	ebx, ebp
jl	short loc_459D9B

loc_459DB0:				; CODE XREF: sub_459D00+99j
mov	dword ptr [edi+114h], 1
pop	ebp

loc_459DBB:				; CODE XREF: sub_459D00+42j
pop	edi
pop	esi
pop	ebx
retn
sub_459D00 endp

; ---------------------------------------------------------------------------
align 10h
; [00000001 BYTES: COLLAPSED FUNCTION nullsub_4. PRESS KEYPAD CTRL-"+" TO EXPAND]
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_459DD0 proc	near			; CODE XREF: sub_459C20+BAp

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	0DDh
push	esi
call	sub_459730
push	4
push	esi
call	sub_459790
mov	eax, [esi+0C8h]
push	eax
push	esi
call	sub_459790
add	esp, 18h
pop	esi
retn
sub_459DD0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_459E00 proc	near			; CODE XREF: sub_459C20+CCp

arg_0= dword ptr  4

push	ebp
push	esi
mov	esi, [esp+8+arg_0]
push	edi
push	0DAh
push	esi
call	sub_459730
mov	eax, [esi+0F4h]
lea	ecx, [eax+eax+6]
push	ecx
push	esi
call	sub_459790
mov	edx, [esi+0F4h]
push	edx
push	esi
call	sub_459750
mov	eax, [esi+0F4h]
add	esp, 18h
xor	ebp, ebp
test	eax, eax
jle	short loc_459EA4
push	ebx
lea	ebx, [esi+0F8h]

loc_459E46:				; CODE XREF: sub_459E00+A1j
mov	edi, [ebx]
mov	eax, [edi]
push	eax
push	esi
call	sub_459750
mov	ecx, [esi+0E4h]
mov	eax, [edi+14h]
mov	edi, [edi+18h]
add	esp, 8
test	ecx, ecx
jz	short loc_459E86
mov	ecx, [esi+13Ch]
test	ecx, ecx
jnz	short loc_459E84
mov	ecx, [esi+144h]
xor	edi, edi
test	ecx, ecx
jz	short loc_459E86
mov	ecx, [esi+0B4h]
test	ecx, ecx
jnz	short loc_459E86

loc_459E84:				; CODE XREF: sub_459E00+6Cj
xor	eax, eax

loc_459E86:				; CODE XREF: sub_459E00+62j
					; sub_459E00+78j ...
shl	eax, 4
add	eax, edi
push	eax
push	esi
call	sub_459750
mov	eax, [esi+0F4h]
add	esp, 8
inc	ebp
add	ebx, 4
cmp	ebp, eax
jl	short loc_459E46
pop	ebx

loc_459EA4:				; CODE XREF: sub_459E00+3Dj
mov	ecx, [esi+13Ch]
push	ecx
push	esi
call	sub_459750
mov	edx, [esi+140h]
push	edx
push	esi
call	sub_459750
mov	eax, [esi+144h]
mov	edi, [esi+148h]
shl	eax, 4
add	eax, edi
push	eax
push	esi
call	sub_459750
add	esp, 18h
pop	edi
pop	esi
pop	ebp
retn
sub_459E00 endp

; ---------------------------------------------------------------------------
align 10h

loc_459EE0:				; DATA XREF: sub_459690+2Co
mov	eax, [esp+4]
push	0D9h
push	eax
call	sub_459730
add	esp, 8
retn
; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_459F00 proc	near			; DATA XREF: sub_459690+33o

arg_0= dword ptr  4

push	ebx
push	esi
push	edi
mov	edi, [esp+0Ch+arg_0]
push	0D8h
push	edi
call	sub_459730
add	esp, 8
xor	esi, esi
lea	ebx, [edi+48h]

loc_459F1A:				; CODE XREF: sub_459F00+30j
cmp	dword ptr [ebx], 0
jz	short loc_459F29
push	esi
push	edi
call	sub_459A80
add	esp, 8

loc_459F29:				; CODE XREF: sub_459F00+1Dj
inc	esi
add	ebx, 4
cmp	esi, 4
jl	short loc_459F1A
mov	eax, [edi+0B4h]
test	eax, eax
jnz	short loc_459F6E
xor	esi, esi
lea	ebx, [edi+68h]

loc_459F41:				; CODE XREF: sub_459F00+6Cj
mov	eax, [ebx-10h]
test	eax, eax
jz	short loc_459F54
push	0
push	esi
push	edi
call	sub_459D00
add	esp, 0Ch

loc_459F54:				; CODE XREF: sub_459F00+46j
cmp	dword ptr [ebx], 0
jz	short loc_459F65
push	1
push	esi
push	edi
call	sub_459D00
add	esp, 0Ch

loc_459F65:				; CODE XREF: sub_459F00+57j
inc	esi
add	ebx, 4
cmp	esi, 4
jl	short loc_459F41

loc_459F6E:				; CODE XREF: sub_459F00+3Aj
push	0D9h
push	edi
call	sub_459730
add	esp, 8
pop	edi
pop	esi
pop	ebx
retn
sub_459F00 endp


; =============== S U B	R O U T	I N E =======================================


sub_459F80 proc	near			; CODE XREF: sub_457070+45p

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	0
push	esi
call	sub_460EF0
mov	eax, [esi+0B0h]
add	esp, 8
test	eax, eax
jnz	short loc_459FB1
push	esi
call	sub_460760
push	esi
call	sub_45FD30
push	0
push	esi
call	sub_45F770
add	esp, 10h

loc_459FB1:				; CODE XREF: sub_459F80+18j
push	esi
call	sub_45F1A0
mov	eax, [esi+0B4h]
add	esp, 4
test	eax, eax
jz	short loc_459FD4
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 1
mov	ecx, [esi]
call	dword ptr [ecx]
jmp	short loc_459FEB
; ---------------------------------------------------------------------------

loc_459FD4:				; CODE XREF: sub_459F80+42j
mov	eax, [esi+0E4h]
push	esi
test	eax, eax
jz	short loc_459FE6
call	sub_45E570
jmp	short loc_459FEB
; ---------------------------------------------------------------------------

loc_459FE6:				; CODE XREF: sub_459F80+5Dj
call	sub_45DBE0

loc_459FEB:				; CODE XREF: sub_459F80+52j
					; sub_459F80+64j
mov	eax, [esi+0A8h]
add	esp, 4
cmp	eax, 1
jg	short loc_45A007
mov	eax, [esi+0B8h]
test	eax, eax
jnz	short loc_45A007
xor	eax, eax
jmp	short loc_45A00C
; ---------------------------------------------------------------------------

loc_45A007:				; CODE XREF: sub_459F80+77j
					; sub_459F80+81j
mov	eax, 1

loc_45A00C:				; CODE XREF: sub_459F80+85j
push	eax
push	esi
call	sub_45CF30
push	0
push	esi
call	sub_45CDA0
push	esi
call	sub_459690
mov	edx, [esi+4]
push	esi
call	dword ptr [edx+18h]
mov	eax, [esi+15Ch]
push	esi
call	dword ptr [eax]
add	esp, 1Ch
pop	esi
retn
sub_459F80 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45A040 proc	near			; CODE XREF: sub_457F10+C9p

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	1Ch
push	0
mov	eax, [esi+4]
push	esi
call	dword ptr [eax]
add	esp, 0Ch
mov	[esi+1B4h], eax
mov	dword ptr [eax], offset	sub_45A350
mov	dword ptr [eax+4], offset sub_45A620
mov	dword ptr [eax+8], offset sub_45A090
mov	dword ptr [eax+0Ch], offset loc_45A330
mov	dword ptr [eax+10h], 0
mov	dword ptr [eax+14h], 0
mov	dword ptr [eax+18h], 1
pop	esi
retn
sub_45A040 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45A090 proc	near			; CODE XREF: sub_45A350+B9p
					; DATA XREF: sub_45A040+25o

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	esi
call	sub_45A0D0
push	esi
call	sub_45A280
mov	eax, [esi+1BCh]
push	esi
call	dword ptr [eax]
mov	ecx, [esi+1ACh]
push	esi
call	dword ptr [ecx]
mov	edx, [esi+1ACh]
mov	eax, [esi+1B4h]
add	esp, 10h
mov	ecx, [edx+4]
mov	[eax], ecx
pop	esi
retn
sub_45A090 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45A0D0 proc	near			; CODE XREF: sub_45A090+6p

var_4= dword ptr -4
arg_0= dword ptr  4

push	ecx
push	ebx
push	esi
mov	esi, [esp+0Ch+arg_0]
mov	ebx, 1
push	edi
mov	eax, [esi+148h]
cmp	eax, ebx
jnz	short loc_45A139
mov	ecx, [esi+14Ch]
mov	eax, [ecx+1Ch]
mov	[esi+15Ch], eax
mov	edx, [ecx+20h]
mov	[esi+160h], edx
mov	eax, [ecx+24h]
mov	edi, [ecx+0Ch]
mov	[ecx+40h], eax
mov	eax, [ecx+20h]
xor	edx, edx
div	edi
mov	[ecx+34h], ebx
mov	[ecx+38h], ebx
mov	[ecx+3Ch], ebx
mov	[ecx+44h], ebx
test	edx, edx
jnz	short loc_45A121
mov	edx, edi

loc_45A121:				; CODE XREF: sub_45A0D0+4Dj
mov	[ecx+48h], edx
mov	[esi+164h], ebx
mov	dword ptr [esi+168h], 0
pop	edi
pop	esi
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_45A139:				; CODE XREF: sub_45A0D0+15j
xor	edi, edi
cmp	eax, edi
jle	short loc_45A144
cmp	eax, 4
jle	short loc_45A169

loc_45A144:				; CODE XREF: sub_45A0D0+6Dj
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 1Ah
mov	edx, [esi]
mov	eax, [esi+148h]
mov	[edx+18h], eax
mov	ecx, [esi]
mov	dword ptr [ecx+1Ch], 4
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4

loc_45A169:				; CODE XREF: sub_45A0D0+72j
mov	eax, [esi+134h]
mov	ecx, [esi+1Ch]
shl	eax, 3
push	eax
push	ecx
call	sub_45CCD0
mov	edx, [esi+138h]
mov	[esi+15Ch], eax
mov	eax, [esi+20h]
shl	edx, 3
push	edx
push	eax
call	sub_45CCD0
mov	[esi+160h], eax
mov	eax, [esi+148h]
add	esp, 10h
cmp	eax, edi
mov	[esi+164h], edi
mov	[esp+10h+arg_0], edi
jle	loc_45A270
lea	ecx, [esi+14Ch]
push	ebp
mov	[esp+14h+var_4], ecx

loc_45A1C1:				; CODE XREF: sub_45A0D0+199j
mov	edx, [esp+14h+var_4]
mov	ecx, [edx]
xor	edx, edx
mov	edi, [ecx+8]
mov	eax, [ecx+24h]
imul	eax, edi
mov	[ecx+40h], eax
mov	eax, [ecx+1Ch]
div	edi
mov	ebp, [ecx+0Ch]
mov	[ecx+34h], edi
mov	ebx, ebp
mov	[ecx+38h], ebp
imul	ebx, edi
mov	[ecx+3Ch], ebx
test	edx, edx
jnz	short loc_45A1F1
mov	edx, edi

loc_45A1F1:				; CODE XREF: sub_45A0D0+11Dj
mov	eax, [ecx+20h]
mov	[ecx+44h], edx
xor	edx, edx
div	ebp
test	edx, edx
jnz	short loc_45A201
mov	edx, ebp

loc_45A201:				; CODE XREF: sub_45A0D0+12Dj
mov	[ecx+48h], edx
mov	ecx, [esi+164h]
add	ecx, ebx
cmp	ecx, 0Ah
jle	short loc_45A222
mov	edx, [esi]
push	esi
mov	dword ptr [edx+14h], 0Dh
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4

loc_45A222:				; CODE XREF: sub_45A0D0+13Fj
mov	ecx, ebx
dec	ebx
test	ecx, ecx
jle	short loc_45A24D
lea	eax, [ebx+1]

loc_45A22C:				; CODE XREF: sub_45A0D0+17Bj
mov	edx, [esi+164h]
mov	ecx, [esp+14h+arg_0]
mov	[esi+edx*4+168h], ecx
mov	edx, [esi+164h]
inc	edx
dec	eax
mov	[esi+164h], edx
jnz	short loc_45A22C

loc_45A24D:				; CODE XREF: sub_45A0D0+157j
mov	eax, [esp+14h+arg_0]
mov	edx, [esp+14h+var_4]
mov	ecx, [esi+148h]
inc	eax
add	edx, 4
cmp	eax, ecx
mov	[esp+14h+arg_0], eax
mov	[esp+14h+var_4], edx
jl	loc_45A1C1
pop	ebp

loc_45A270:				; CODE XREF: sub_45A0D0+E0j
pop	edi
pop	esi
pop	ebx
pop	ecx
retn
sub_45A0D0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45A280 proc	near			; CODE XREF: sub_45A090+Cp

var_4= dword ptr -4
arg_0= dword ptr  4

push	ecx
push	ebx
mov	ebx, [esp+8+arg_0]
mov	[esp+8+var_4], 0
mov	eax, [ebx+148h]
test	eax, eax
jle	loc_45A327
push	ebp
lea	eax, [ebx+14Ch]
push	esi
push	edi
mov	[esp+14h+arg_0], eax

loc_45A2A9:				; CODE XREF: sub_45A280+A2j
mov	ecx, [esp+14h+arg_0]
mov	ebp, [ecx]
mov	eax, [ebp+4Ch]
test	eax, eax
jnz	short loc_45A306
mov	esi, [ebp+10h]
test	esi, esi
jl	short loc_45A2CD
cmp	esi, 4
jge	short loc_45A2CD
mov	eax, [ebx+esi*4+0A4h]
test	eax, eax
jnz	short loc_45A2E3

loc_45A2CD:				; CODE XREF: sub_45A280+3Bj
					; sub_45A280+40j
mov	edx, [ebx]
push	ebx
mov	dword ptr [edx+14h], 34h
mov	eax, [ebx]
mov	[eax+18h], esi
mov	ecx, [ebx]
call	dword ptr [ecx]
add	esp, 4

loc_45A2E3:				; CODE XREF: sub_45A280+4Bj
mov	edx, [ebx+4]
push	84h
push	1
push	ebx
call	dword ptr [edx]
mov	esi, [ebx+esi*4+0A4h]
mov	ecx, 21h
mov	edi, eax
add	esp, 0Ch
rep movsd
mov	[ebp+4Ch], eax

loc_45A306:				; CODE XREF: sub_45A280+34j
mov	eax, [esp+14h+var_4]
mov	edx, [esp+14h+arg_0]
mov	ecx, [ebx+148h]
inc	eax
add	edx, 4
cmp	eax, ecx
mov	[esp+14h+var_4], eax
mov	[esp+14h+arg_0], edx
jl	short loc_45A2A9
pop	edi
pop	esi
pop	ebp

loc_45A327:				; CODE XREF: sub_45A280+16j
pop	ebx
pop	ecx
retn
sub_45A280 endp

; ---------------------------------------------------------------------------
align 10h

loc_45A330:				; DATA XREF: sub_45A040+2Co
mov	eax, [esp+4]
mov	ecx, [eax+1B4h]
mov	dword ptr [ecx], offset	sub_45A350
retn
; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45A350 proc	near			; DATA XREF: sub_45A040+18o
					; .text:0045A33Ao ...

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	edi
mov	edi, [esi+1B4h]
mov	eax, [edi+14h]
test	eax, eax
jz	short loc_45A36B
pop	edi
mov	eax, 2
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45A36B:				; CODE XREF: sub_45A350+11j
mov	eax, [esi+1B8h]
push	ebx
push	esi
call	dword ptr [eax+4]
add	esp, 4
mov	ebx, eax
dec	eax
jz	short loc_45A3D3
dec	eax
jnz	loc_45A411
mov	eax, [edi+18h]
mov	dword ptr [edi+14h], 1
test	eax, eax
jz	short loc_45A3B7
mov	ecx, [esi+1B8h]
mov	eax, [ecx+10h]
test	eax, eax
jz	short loc_45A411
mov	edx, [esi]
push	esi
mov	dword ptr [edx+14h], 3Bh
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4
mov	eax, ebx
pop	ebx
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45A3B7:				; CODE XREF: sub_45A350+41j
mov	eax, [esi+90h]
mov	ecx, [esi+98h]
cmp	ecx, eax
jle	short loc_45A411
mov	[esi+98h], eax
mov	eax, ebx
pop	ebx
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45A3D3:				; CODE XREF: sub_45A350+2Cj
mov	eax, [edi+18h]
test	eax, eax
jz	short loc_45A3F0
push	esi
call	sub_45A420
add	esp, 4
mov	eax, ebx
mov	dword ptr [edi+18h], 0
pop	ebx
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45A3F0:				; CODE XREF: sub_45A350+88j
mov	eax, [edi+10h]
test	eax, eax
jnz	short loc_45A408
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 23h
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4

loc_45A408:				; CODE XREF: sub_45A350+A5j
push	esi
call	sub_45A090
add	esp, 4

loc_45A411:				; CODE XREF: sub_45A350+2Fj
					; sub_45A350+4Ej ...
mov	eax, ebx
pop	ebx
pop	edi
pop	esi
retn
sub_45A350 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45A420 proc	near			; CODE XREF: sub_45A350+8Bp

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
mov	eax, 0FFDCh
cmp	[esi+20h], eax
jg	short loc_45A434
cmp	[esi+1Ch], eax
jle	short loc_45A44A

loc_45A434:				; CODE XREF: sub_45A420+Dj
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 29h
mov	edx, [esi]
mov	[edx+18h], eax
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4

loc_45A44A:				; CODE XREF: sub_45A420+12j
cmp	dword ptr [esi+0D4h], 8
jz	short loc_45A46F
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 0Fh
mov	edx, [esi]
mov	eax, [esi+0D4h]
mov	[edx+18h], eax
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4

loc_45A46F:				; CODE XREF: sub_45A420+31j
mov	ecx, [esi+24h]
mov	eax, 0Ah
cmp	ecx, eax
jle	short loc_45A499
mov	edx, [esi]
push	esi
mov	dword ptr [edx+14h], 1Ah
mov	ecx, [esi]
mov	edx, [esi+24h]
mov	[ecx+18h], edx
mov	ecx, [esi]
mov	[ecx+1Ch], eax
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4

loc_45A499:				; CODE XREF: sub_45A420+59j
mov	ecx, [esi+24h]
push	ebx
mov	eax, 1
xor	ebx, ebx
mov	[esi+134h], eax
mov	[esi+138h], eax
mov	eax, [esi+0D8h]
push	edi
test	ecx, ecx
jle	short loc_45A51A
lea	edi, [eax+0Ch]

loc_45A4BE:				; CODE XREF: sub_45A420+F8j
mov	eax, [edi-4]
test	eax, eax
jle	short loc_45A4D5
cmp	eax, 4
jg	short loc_45A4D5
mov	eax, [edi]
test	eax, eax
jle	short loc_45A4D5
cmp	eax, 4
jle	short loc_45A4E6

loc_45A4D5:				; CODE XREF: sub_45A420+A3j
					; sub_45A420+A8j ...
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 12h
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4

loc_45A4E6:				; CODE XREF: sub_45A420+B3j
mov	eax, [esi+134h]
mov	ecx, [edi-4]
cmp	eax, ecx
jg	short loc_45A4F5
mov	eax, ecx

loc_45A4F5:				; CODE XREF: sub_45A420+D1j
mov	[esi+134h], eax
mov	eax, [esi+138h]
mov	ecx, [edi]
cmp	eax, ecx
jg	short loc_45A509
mov	eax, ecx

loc_45A509:				; CODE XREF: sub_45A420+E5j
mov	[esi+138h], eax
mov	eax, [esi+24h]
inc	ebx
add	edi, 54h
cmp	ebx, eax
jl	short loc_45A4BE

loc_45A51A:				; CODE XREF: sub_45A420+99j
mov	ecx, [esi+24h]
mov	eax, [esi+0D8h]
xor	ebx, ebx
mov	dword ptr [esi+13Ch], 8
test	ecx, ecx
jle	loc_45A5C2
lea	edi, [eax+1Ch]

loc_45A53A:				; CODE XREF: sub_45A420+19Cj
mov	eax, [edi-14h]
mov	dword ptr [edi+8], 8
imul	eax, [esi+1Ch]
mov	edx, [esi+134h]
shl	edx, 3
push	edx
push	eax
call	sub_45CCD0
mov	edx, [edi-10h]
mov	[edi], eax
imul	edx, [esi+20h]
mov	ecx, [esi+138h]
shl	ecx, 3
push	ecx
push	edx
call	sub_45CCD0
mov	ecx, [edi-14h]
mov	[edi+4], eax
imul	ecx, [esi+1Ch]
mov	eax, [esi+134h]
push	eax
push	ecx
call	sub_45CCD0
mov	[edi+0Ch], eax
mov	eax, [edi-10h]
imul	eax, [esi+20h]
mov	edx, [esi+138h]
push	edx
push	eax
call	sub_45CCD0
add	esp, 20h
mov	[edi+10h], eax
mov	dword ptr [edi+14h], 1
mov	dword ptr [edi+30h], 0
mov	eax, [esi+24h]
inc	ebx
add	edi, 54h
cmp	ebx, eax
jl	loc_45A53A

loc_45A5C2:				; CODE XREF: sub_45A420+111j
mov	ecx, [esi+138h]
mov	edx, [esi+20h]
shl	ecx, 3
push	ecx
push	edx
call	sub_45CCD0
mov	ecx, [esi+24h]
add	esp, 8
mov	[esi+140h], eax
mov	eax, [esi+148h]
pop	edi
cmp	eax, ecx
pop	ebx
jl	short loc_45A606
mov	eax, [esi+0DCh]
test	eax, eax
jnz	short loc_45A606
mov	ecx, [esi+1B4h]
pop	esi
mov	dword ptr [ecx+10h], 0
retn
; ---------------------------------------------------------------------------

loc_45A606:				; CODE XREF: sub_45A420+1CBj
					; sub_45A420+1D5j
mov	edx, [esi+1B4h]
pop	esi
mov	dword ptr [edx+10h], 1
retn
sub_45A420 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45A620 proc	near			; DATA XREF: sub_45A040+1Eo

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	esi
mov	eax, [esi+1B4h]
mov	dword ptr [eax], offset	sub_45A350
mov	dword ptr [eax+10h], 0
mov	dword ptr [eax+14h], 0
mov	dword ptr [eax+18h], 1
mov	eax, [esi]
call	dword ptr [eax+10h]
mov	ecx, [esi+1B8h]
push	esi
call	dword ptr [ecx]
add	esp, 8
mov	dword ptr [esi+0A0h], 0
pop	esi
retn
sub_45A620 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45A670 proc	near			; DATA XREF: sub_458870+4Do

arg_0= dword ptr  4
arg_4= dword ptr  8

push	ebx
push	ebp
push	esi
push	edi
mov	edi, [esp+10h+arg_0]
mov	ebp, [esp+10h+arg_4]
push	0FFFFFFFFh
push	edi
mov	eax, [edi]
mov	esi, [edi+1A0h]
mov	dword ptr [eax+14h], 79h
mov	ecx, [edi]
mov	[ecx+18h], esi
mov	edx, [edi]
mov	[edx+1Ch], ebp
mov	eax, [edi]
call	dword ptr [eax+4]
add	esp, 8

loc_45A6A0:				; CODE XREF: sub_45A670+C1j
					; sub_45A670+D9j
cmp	esi, 0C0h
jge	short loc_45A6AF

loc_45A6A8:				; CODE XREF: sub_45A670+7Cj
					; sub_45A670+8Cj
mov	ebx, 2
jmp	short loc_45A70A
; ---------------------------------------------------------------------------

loc_45A6AF:				; CODE XREF: sub_45A670+36j
cmp	esi, 0D0h
jl	short loc_45A705
cmp	esi, 0D7h
jg	short loc_45A705
lea	ecx, [ebp+1]
and	ecx, 7
add	ecx, 0D0h
cmp	esi, ecx
jz	short loc_45A705
lea	edx, [ebp+2]
and	edx, 7
add	edx, 0D0h
cmp	esi, edx
jz	short loc_45A705
lea	eax, [ebp-1]
and	eax, 7
add	eax, 0D0h
cmp	esi, eax
jz	short loc_45A6A8
lea	ecx, [ebp-2]
and	ecx, 7
add	ecx, 0D0h
cmp	esi, ecx
jz	short loc_45A6A8
mov	ebx, 1
jmp	short loc_45A70A
; ---------------------------------------------------------------------------

loc_45A705:				; CODE XREF: sub_45A670+45j
					; sub_45A670+4Dj ...
mov	ebx, 3

loc_45A70A:				; CODE XREF: sub_45A670+3Dj
					; sub_45A670+93j
mov	edx, [edi]
push	4
push	edi
mov	dword ptr [edx+14h], 61h
mov	eax, [edi]
mov	[eax+18h], esi
mov	ecx, [edi]
mov	[ecx+1Ch], ebx
mov	edx, [edi]
call	dword ptr [edx+4]
add	esp, 8
dec	ebx
jz	short loc_45A755
dec	ebx
jz	short loc_45A736
dec	ebx
jz	short loc_45A75F
jmp	loc_45A6A0
; ---------------------------------------------------------------------------

loc_45A736:				; CODE XREF: sub_45A670+BCj
push	edi
call	sub_45A770
add	esp, 4
test	eax, eax
jz	short loc_45A74E
mov	esi, [edi+1A0h]
jmp	loc_45A6A0
; ---------------------------------------------------------------------------

loc_45A74E:				; CODE XREF: sub_45A670+D1j
pop	edi
pop	esi
pop	ebp
xor	eax, eax
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_45A755:				; CODE XREF: sub_45A670+B9j
mov	dword ptr [edi+1A0h], 0

loc_45A75F:				; CODE XREF: sub_45A670+BFj
pop	edi
pop	esi
pop	ebp
mov	eax, 1
pop	ebx
retn
sub_45A670 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45A770 proc	near			; CODE XREF: sub_45A670+C7p
					; sub_45AE60:loc_45AE8Ep ...

arg_0= dword ptr  4

push	ebx
push	ebp
mov	ebp, [esp+8+arg_0]
push	esi
push	edi
mov	ebx, [ebp+18h]
mov	edi, [ebx]
mov	esi, [ebx+4]

loc_45A780:				; CODE XREF: sub_45A770+A5j
test	esi, esi
jnz	short loc_45A798
push	ebp
call	dword ptr [ebx+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45A81A
mov	edi, [ebx]
mov	esi, [ebx+4]

loc_45A798:				; CODE XREF: sub_45A770+12j
xor	eax, eax
dec	esi
mov	al, [edi]
inc	edi
cmp	eax, 0FFh
jz	short loc_45A7D8

loc_45A7A5:				; CODE XREF: sub_45A770+66j
mov	eax, [ebp+1B8h]
mov	ecx, [eax+18h]
inc	ecx
mov	[eax+18h], ecx
mov	[ebx], edi
test	esi, esi
mov	[ebx+4], esi
jnz	short loc_45A7CB
push	ebp
call	dword ptr [ebx+0Ch]
add	esp, 4
test	eax, eax
jz	short loc_45A81A
mov	edi, [ebx]
mov	esi, [ebx+4]

loc_45A7CB:				; CODE XREF: sub_45A770+49j
xor	eax, eax
dec	esi
mov	al, [edi]
inc	edi
cmp	eax, 0FFh
jnz	short loc_45A7A5

loc_45A7D8:				; CODE XREF: sub_45A770+33j
					; sub_45A770+8Bj
test	esi, esi
jnz	short loc_45A7EC
push	ebp
call	dword ptr [ebx+0Ch]
add	esp, 4
test	eax, eax
jz	short loc_45A81A
mov	edi, [ebx]
mov	esi, [ebx+4]

loc_45A7EC:				; CODE XREF: sub_45A770+6Aj
xor	eax, eax
dec	esi
mov	al, [edi]
inc	edi
cmp	eax, 0FFh
mov	[esp+10h+arg_0], eax
jz	short loc_45A7D8
test	eax, eax
jnz	short loc_45A821
mov	eax, [ebp+1B8h]
mov	ecx, [eax+18h]
add	ecx, 2
mov	[eax+18h], ecx
mov	[ebx], edi
mov	[ebx+4], esi
jmp	loc_45A780
; ---------------------------------------------------------------------------

loc_45A81A:				; CODE XREF: sub_45A770+1Dj
					; sub_45A770+54j ...
pop	edi
pop	esi
pop	ebp
xor	eax, eax
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_45A821:				; CODE XREF: sub_45A770+8Fj
mov	ecx, [ebp+1B8h]
mov	edx, [ecx+18h]
test	edx, edx
jz	short loc_45A86A
mov	edx, [ebp+0]
push	0FFFFFFFFh
push	ebp
mov	dword ptr [edx+14h], 74h
mov	ecx, [ebp+1B8h]
mov	edx, [ebp+0]
mov	ecx, [ecx+18h]
mov	[edx+18h], ecx
mov	edx, [ebp+0]
mov	[edx+1Ch], eax
mov	eax, [ebp+0]
call	dword ptr [eax+4]
mov	ecx, [ebp+1B8h]
mov	eax, [esp+18h+arg_0]
add	esp, 8
mov	dword ptr [ecx+18h], 0

loc_45A86A:				; CODE XREF: sub_45A770+BCj
mov	[ebp+1A0h], eax
mov	[ebx], edi
mov	[ebx+4], esi
pop	edi
pop	esi
pop	ebp
mov	eax, 1
pop	ebx
retn
sub_45A770 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45A880 proc	near			; CODE XREF: sub_457F10+C3p

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	0ACh
push	0
mov	eax, [esi+4]
push	esi
call	dword ptr [eax]
mov	[esi+1B8h], eax
add	esp, 0Ch
mov	dword ptr [eax], offset	loc_45C0E0
mov	dword ptr [eax+4], offset sub_45AE60
mov	dword ptr [eax+8], offset sub_45C050
mov	dword ptr [eax+1Ch], offset sub_45ADB0
mov	dword ptr [eax+60h], 0
lea	ecx, [eax+64h]
mov	edx, 10h

loc_45A8C5:				; CODE XREF: sub_45A880+56j
mov	dword ptr [ecx-44h], offset sub_45ADB0
mov	dword ptr [ecx], 0
add	ecx, 4
dec	edx
jnz	short loc_45A8C5
mov	ecx, offset loc_45A8F0
push	esi
mov	[eax+20h], ecx
mov	[eax+58h], ecx
call	loc_45C0E0
add	esp, 4
pop	esi
retn
sub_45A880 endp

; ---------------------------------------------------------------------------
align 10h

loc_45A8F0:				; DATA XREF: sub_45A880+58o
					; .text:loc_45C197o
mov	eax, [esp+4]
sub	esp, 18h
push	ebx
mov	ebx, [eax+18h]
push	ebp
push	esi
mov	esi, [ebx+4]
push	edi
mov	edi, [ebx]
test	esi, esi
jnz	short loc_45A91B
push	eax
call	dword ptr [ebx+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45A9DD
mov	edi, [ebx]
mov	esi, [ebx+4]

loc_45A91B:				; CODE XREF: .text:0045A905j
xor	eax, eax
dec	esi
mov	ah, [edi]
inc	edi
test	esi, esi
mov	ebp, eax
jnz	short loc_45A93F
mov	ecx, [esp+2Ch]
push	ecx
call	dword ptr [ebx+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45A9DD
mov	edi, [ebx]
mov	esi, [ebx+4]

loc_45A93F:				; CODE XREF: .text:0045A925j
xor	edx, edx
dec	esi
mov	dl, [edi]
add	ebp, edx
inc	edi
sub	ebp, 2
cmp	ebp, 0Eh
mov	[esp+14h], ebp
jl	short loc_45A95E
mov	eax, 0Eh
mov	[esp+10h], eax
jmp	short loc_45A96C
; ---------------------------------------------------------------------------

loc_45A95E:				; CODE XREF: .text:0045A951j
xor	eax, eax
test	ebp, ebp
setle	al
dec	eax
and	eax, ebp
mov	[esp+10h], eax

loc_45A96C:				; CODE XREF: .text:0045A95Cj
xor	ebp, ebp
test	eax, eax
jbe	short loc_45A99B

loc_45A972:				; CODE XREF: .text:0045A999j
test	esi, esi
jnz	short loc_45A98E
mov	ecx, [esp+2Ch]
push	ecx
call	dword ptr [ebx+0Ch]
add	esp, 4
test	eax, eax
jz	short loc_45A9DD
mov	edi, [ebx]
mov	esi, [ebx+4]
mov	eax, [esp+10h]

loc_45A98E:				; CODE XREF: .text:0045A974j
mov	dl, [edi]
dec	esi
mov	[esp+ebp+18h], dl
inc	edi
inc	ebp
cmp	ebp, eax
jb	short loc_45A972

loc_45A99B:				; CODE XREF: .text:0045A970j
mov	ebp, [esp+2Ch]
mov	edx, [esp+14h]
sub	edx, eax
mov	ecx, [ebp+1A0h]
mov	[esp+14h], edx
sub	ecx, 0E0h
jz	short loc_45A9F6
sub	ecx, 0Eh
jz	short loc_45A9E7
mov	eax, [ebp+0]
push	ebp
mov	dword ptr [eax+14h], 44h
mov	ecx, [ebp+0]
mov	edx, [ebp+1A0h]
mov	[ecx+18h], edx
mov	eax, [ebp+0]
call	dword ptr [eax]
add	esp, 4
jmp	short loc_45AA06
; ---------------------------------------------------------------------------

loc_45A9DD:				; CODE XREF: .text:0045A910j
					; .text:0045A934j ...
pop	edi
pop	esi
pop	ebp
xor	eax, eax
pop	ebx
add	esp, 18h
retn
; ---------------------------------------------------------------------------

loc_45A9E7:				; CODE XREF: .text:0045A9BAj
push	edx
lea	ecx, [esp+1Ch]
push	eax
push	ecx
push	ebp
call	sub_45ACC0
jmp	short loc_45AA03
; ---------------------------------------------------------------------------

loc_45A9F6:				; CODE XREF: .text:0045A9B5j
push	edx
lea	edx, [esp+1Ch]
push	eax
push	edx
push	ebp
call	sub_45AA30

loc_45AA03:				; CODE XREF: .text:0045A9F4j
add	esp, 10h

loc_45AA06:				; CODE XREF: .text:0045A9DBj
mov	eax, [esp+14h]
mov	[ebx], edi
test	eax, eax
mov	[ebx+4], esi
jle	short loc_45AA1E
mov	ecx, [ebp+18h]
push	eax
push	ebp
call	dword ptr [ecx+10h]
add	esp, 8

loc_45AA1E:				; CODE XREF: .text:0045AA11j
pop	edi
pop	esi
pop	ebp
mov	eax, 1
pop	ebx
add	esp, 18h
retn
; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45AA30 proc	near			; CODE XREF: .text:0045A9FEp
					; sub_45C1F0+255p

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

mov	eax, [esp+arg_8]
mov	ecx, [esp+arg_C]
push	ebp
push	esi
push	edi
mov	edi, [esp+0Ch+arg_4]
lea	ebp, [eax+ecx]
cmp	eax, 0Eh
mov	cl, 46h
jb	loc_45ABC5
cmp	byte ptr [edi],	4Ah
jnz	loc_45ABC5
cmp	[edi+1], cl
jnz	loc_45ABC5
cmp	byte ptr [edi+2], 49h
jnz	loc_45ABC5
cmp	[edi+3], cl
jnz	loc_45ABC5
mov	dl, [edi+4]
test	dl, dl
jnz	loc_45ABC5
mov	esi, [esp+0Ch+arg_0]
mov	dword ptr [esi+118h], 1
mov	dl, [edi+5]
mov	[esi+11Ch], dl
mov	al, [edi+6]
mov	[esi+11Dh], al
mov	cl, [edi+7]
mov	[esi+11Eh], cl
movzx	dx, byte ptr [edi+8]
movzx	ax, byte ptr [edi+9]
shl	edx, 8
add	edx, eax
mov	al, [esi+11Ch]
mov	[esi+120h], dx
movzx	cx, byte ptr [edi+0Ah]
movzx	dx, byte ptr [edi+0Bh]
shl	ecx, 8
add	ecx, edx
cmp	al, 1
mov	[esi+122h], cx
jz	short loc_45AB0A
mov	eax, [esi]
xor	ecx, ecx
push	0FFFFFFFFh
push	esi
mov	dword ptr [eax+14h], 77h
mov	edx, [esi]
mov	cl, [esi+11Ch]
xor	eax, eax
mov	[edx+18h], ecx
mov	ecx, [esi]
mov	al, [esi+11Dh]
mov	[ecx+1Ch], eax
mov	edx, [esi]
call	dword ptr [edx+4]
add	esp, 8

loc_45AB0A:				; CODE XREF: sub_45AA30+AAj
mov	eax, [esi]
xor	ecx, ecx
mov	cl, [esi+11Ch]
add	eax, 18h
xor	edx, edx
push	1
mov	[eax], ecx
mov	dl, [esi+11Dh]
xor	ecx, ecx
mov	[eax+4], edx
mov	cx, [esi+120h]
xor	edx, edx
mov	[eax+8], ecx
mov	dx, [esi+122h]
xor	ecx, ecx
mov	[eax+0Ch], edx
mov	cl, [esi+11Eh]
push	esi
mov	[eax+10h], ecx
mov	edx, [esi]
mov	dword ptr [edx+14h], 57h
mov	eax, [esi]
call	dword ptr [eax+4]
mov	cl, [edi+0Ch]
mov	al, [edi+0Dh]
add	esp, 8
or	cl, al
jz	short loc_45AB8D
mov	edx, [esi]
xor	eax, eax
push	1
push	esi
mov	dword ptr [edx+14h], 5Ah
mov	ecx, [esi]
mov	al, [edi+0Ch]
xor	edx, edx
mov	[ecx+18h], eax
mov	eax, [esi]
mov	dl, [edi+0Dh]
mov	[eax+1Ch], edx
mov	ecx, [esi]
call	dword ptr [ecx+4]
add	esp, 8

loc_45AB8D:				; CODE XREF: sub_45AA30+133j
xor	eax, eax
xor	edx, edx
mov	al, [edi+0Ch]
mov	dl, [edi+0Dh]
imul	eax, edx
sub	ebp, 0Eh
lea	eax, [eax+eax*2]
cmp	ebp, eax
jz	loc_45ACBA
mov	ecx, [esi]
push	1
push	esi
mov	dword ptr [ecx+14h], 58h
mov	edx, [esi]
mov	[edx+18h], ebp
mov	eax, [esi]
call	dword ptr [eax+4]
add	esp, 8
pop	edi
pop	esi
pop	ebp
retn
; ---------------------------------------------------------------------------

loc_45ABC5:				; CODE XREF: sub_45AA30+17j
					; sub_45AA30+20j ...
cmp	eax, 6
jb	loc_45AC9D
cmp	byte ptr [edi],	4Ah
jnz	loc_45AC9D
cmp	[edi+1], cl
jnz	loc_45AC9D
mov	cl, [edi+2]
mov	al, 58h
cmp	cl, al
jnz	loc_45AC9D
cmp	[edi+3], al
jnz	loc_45AC9D
mov	al, [edi+4]
test	al, al
jnz	loc_45AC9D
xor	eax, eax
mov	al, [edi+5]
sub	eax, 10h
jz	short loc_45AC7C
dec	eax
jz	short loc_45AC5B
sub	eax, 2
mov	eax, [esp+0Ch+arg_0]
jz	short loc_45AC3E
mov	ecx, [eax]
xor	edx, edx
push	1
push	eax
mov	dword ptr [ecx+14h], 59h
mov	ecx, [eax]
mov	dl, [edi+5]
mov	[ecx+18h], edx
mov	edx, [eax]
mov	[edx+1Ch], ebp
mov	ecx, [eax]
call	dword ptr [ecx+4]
add	esp, 8
pop	edi
pop	esi
pop	ebp
retn
; ---------------------------------------------------------------------------

loc_45AC3E:				; CODE XREF: sub_45AA30+1E5j
mov	edx, [eax]
push	1
push	eax
mov	dword ptr [edx+14h], 6Eh
mov	ecx, [eax]
mov	[ecx+18h], ebp
mov	edx, [eax]
call	dword ptr [edx+4]
add	esp, 8
pop	edi
pop	esi
pop	ebp
retn
; ---------------------------------------------------------------------------

loc_45AC5B:				; CODE XREF: sub_45AA30+1DCj
mov	eax, [esp+0Ch+arg_0]
push	1
push	eax
mov	ecx, [eax]
mov	dword ptr [ecx+14h], 6Dh
mov	edx, [eax]
mov	[edx+18h], ebp
mov	ecx, [eax]
call	dword ptr [ecx+4]
add	esp, 8
pop	edi
pop	esi
pop	ebp
retn
; ---------------------------------------------------------------------------

loc_45AC7C:				; CODE XREF: sub_45AA30+1D9j
mov	eax, [esp+0Ch+arg_0]
push	1
push	eax
mov	edx, [eax]
mov	dword ptr [edx+14h], 6Ch
mov	ecx, [eax]
mov	[ecx+18h], ebp
mov	edx, [eax]
call	dword ptr [edx+4]
add	esp, 8
pop	edi
pop	esi
pop	ebp
retn
; ---------------------------------------------------------------------------

loc_45AC9D:				; CODE XREF: sub_45AA30+198j
					; sub_45AA30+1A1j ...
mov	eax, [esp+0Ch+arg_0]
push	1
push	eax
mov	ecx, [eax]
mov	dword ptr [ecx+14h], 4Dh
mov	edx, [eax]
mov	[edx+18h], ebp
mov	ecx, [eax]
call	dword ptr [ecx+4]
add	esp, 8

loc_45ACBA:				; CODE XREF: sub_45AA30+172j
pop	edi
pop	esi
pop	ebp
retn
sub_45AA30 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45ACC0 proc	near			; CODE XREF: .text:0045A9EFp
					; sub_45C1F0+246p

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

mov	ecx, [esp+arg_8]
cmp	ecx, 0Ch
jb	loc_45AD7D
mov	eax, [esp+arg_4]
cmp	byte ptr [eax],	41h
jnz	loc_45AD7D
cmp	byte ptr [eax+1], 64h
jnz	loc_45AD7D
cmp	byte ptr [eax+2], 6Fh
jnz	loc_45AD7D
cmp	byte ptr [eax+3], 62h
jnz	loc_45AD7D
cmp	byte ptr [eax+4], 65h
jnz	short loc_45AD7D
push	ebx
xor	ecx, ecx
mov	cl, [eax+7]
push	ebp
push	esi
push	edi
mov	edi, ecx
xor	edx, edx
mov	dl, [eax+8]
xor	ecx, ecx
mov	cl, [eax+9]
mov	esi, [esp+10h+arg_0]
shl	edi, 8
add	edi, edx
mov	ebp, ecx
xor	edx, edx
xor	ecx, ecx
mov	dl, [eax+0Ah]
mov	cl, [eax+0Bh]
shl	ebp, 8
add	ebp, edx
xor	edx, edx
mov	dl, [eax+5]
xor	ebx, ebx
mov	bl, [eax+6]
mov	[esp+10h+arg_8], ecx
mov	ecx, [esi]
mov	[ecx+1Ch], edi
shl	edx, 8
add	ecx, 18h
add	edx, ebx
mov	ebx, [esp+10h+arg_8]
push	1
mov	[ecx], edx
mov	[ecx+8], ebp
mov	[ecx+0Ch], ebx
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 4Ch
mov	ecx, [esi]
call	dword ptr [ecx+4]
add	esp, 8
mov	dword ptr [esi+124h], 1
mov	[esi+128h], bl
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_45AD7D:				; CODE XREF: sub_45ACC0+7j
					; sub_45ACC0+14j ...
mov	eax, [esp+arg_0]
push	1
push	eax
mov	edx, [eax]
mov	dword ptr [edx+14h], 4Eh
mov	edx, [esp+8+arg_C]
add	ecx, edx
mov	edx, [eax]
mov	[edx+18h], ecx
mov	ecx, [eax]
call	dword ptr [ecx+4]
add	esp, 8
retn
sub_45ACC0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45ADB0 proc	near			; CODE XREF: sub_45AE60+183p
					; DATA XREF: sub_45A880+2Fo ...

arg_0= dword ptr  4

push	ebx
push	ebp
push	esi
mov	esi, [esp+0Ch+arg_0]
push	edi
mov	edi, [esi+18h]
mov	ebp, [edi+4]
mov	ebx, [edi]
test	ebp, ebp
jnz	short loc_45ADD4
push	esi
call	dword ptr [edi+0Ch]
add	esp, 4
test	eax, eax
jz	short loc_45AE4A
mov	ebx, [edi]
mov	ebp, [edi+4]

loc_45ADD4:				; CODE XREF: sub_45ADB0+12j
xor	eax, eax
dec	ebp
mov	ah, [ebx]
inc	ebx
test	ebp, ebp
mov	[esp+10h+arg_0], eax
jnz	short loc_45ADF2
push	esi
call	dword ptr [edi+0Ch]
add	esp, 4
test	eax, eax
jz	short loc_45AE4A
mov	ebx, [edi]
mov	ebp, [edi+4]

loc_45ADF2:				; CODE XREF: sub_45ADB0+30j
mov	edx, [esp+10h+arg_0]
xor	ecx, ecx
mov	cl, [ebx]
push	1
push	esi
lea	eax, [edx+ecx-2]
mov	ecx, [esi]
mov	[esp+18h+arg_0], eax
mov	dword ptr [ecx+14h], 5Bh
mov	edx, [esi]
mov	ecx, [esi+1A0h]
mov	[edx+18h], ecx
mov	edx, [esi]
mov	[edx+1Ch], eax
mov	eax, [esi]
call	dword ptr [eax+4]
mov	eax, [esp+18h+arg_0]
add	esp, 8
inc	ebx
dec	ebp
test	eax, eax
mov	[edi], ebx
mov	[edi+4], ebp
jle	short loc_45AE40
mov	ecx, [esi+18h]
push	eax
push	esi
call	dword ptr [ecx+10h]
add	esp, 8

loc_45AE40:				; CODE XREF: sub_45ADB0+83j
pop	edi
pop	esi
pop	ebp
mov	eax, 1
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_45AE4A:				; CODE XREF: sub_45ADB0+1Dj
					; sub_45ADB0+3Bj
pop	edi
pop	esi
pop	ebp
xor	eax, eax
pop	ebx
retn
sub_45ADB0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45AE60 proc	near			; DATA XREF: sub_45A880+21o

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	edi
xor	edi, edi

loc_45AE68:				; CODE XREF: sub_45AE60+94j
					; sub_45AE60+BBj ...
cmp	[esi+1A0h], edi
jnz	short loc_45AE9E
mov	eax, [esi+1B8h]
push	esi
cmp	[eax+0Ch], edi
jnz	short loc_45AE8E
call	sub_45BFB0
add	esp, 4
test	eax, eax
jz	loc_45B05E
jmp	short loc_45AE9E
; ---------------------------------------------------------------------------

loc_45AE8E:				; CODE XREF: sub_45AE60+1Aj
call	sub_45A770
add	esp, 4
test	eax, eax
jz	loc_45B05E

loc_45AE9E:				; CODE XREF: sub_45AE60+Ej
					; sub_45AE60+2Cj
mov	eax, [esi+1A0h]
lea	ecx, [eax-1]			; switch 254 cases
cmp	ecx, 0FDh
ja	loc_45AFFA			; jumptable 0045AEBB default case
xor	edx, edx
mov	dl, ds:byte_45B0A4[ecx]
jmp	ds:off_45B064[edx*4]		; switch jump
; ---------------------------------------------------------------------------

loc_45AEC2:				; CODE XREF: sub_45AE60+5Bj
					; DATA XREF: .text:off_45B064o
push	esi				; jumptable 0045AEBB case 216
call	sub_45B1B0
add	esp, 4
jmp	short loc_45AEE6
; ---------------------------------------------------------------------------

loc_45AECD:				; CODE XREF: sub_45AE60+5Bj
					; DATA XREF: .text:off_45B064o
push	edi				; jumptable 0045AEBB cases 192,193
push	edi
jmp	short loc_45AEDD
; ---------------------------------------------------------------------------

loc_45AED1:				; CODE XREF: sub_45AE60+5Bj
					; DATA XREF: .text:off_45B064o
push	edi				; jumptable 0045AEBB case 194
jmp	short loc_45AEDB
; ---------------------------------------------------------------------------

loc_45AED4:				; CODE XREF: sub_45AE60+5Bj
					; DATA XREF: .text:off_45B064o
push	1				; jumptable 0045AEBB case 201
push	edi
jmp	short loc_45AEDD
; ---------------------------------------------------------------------------

loc_45AED9:				; CODE XREF: sub_45AE60+5Bj
					; DATA XREF: .text:off_45B064o
push	1				; jumptable 0045AEBB case 202

loc_45AEDB:				; CODE XREF: sub_45AE60+72j
push	1

loc_45AEDD:				; CODE XREF: sub_45AE60+6Fj
					; sub_45AE60+77j
push	esi
call	sub_45B270
add	esp, 0Ch

loc_45AEE6:				; CODE XREF: sub_45AE60+6Bj
test	eax, eax
jz	loc_45B05E
mov	[esi+1A0h], edi
jmp	loc_45AE68
; ---------------------------------------------------------------------------

loc_45AEF9:				; CODE XREF: sub_45AE60+5Bj
					; DATA XREF: .text:off_45B064o
mov	eax, [esi]			; jumptable 0045AEBB cases 195,197-200,203,205-207
push	esi
mov	dword ptr [eax+14h], 3Ch
mov	ecx, [esi]
mov	edx, [esi+1A0h]
mov	[ecx+18h], edx
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4
mov	[esi+1A0h], edi
jmp	loc_45AE68
; ---------------------------------------------------------------------------

loc_45AF20:				; CODE XREF: sub_45AE60+5Bj
					; DATA XREF: .text:off_45B064o
push	esi				; jumptable 0045AEBB case 196
call	sub_45B8C0
add	esp, 4
test	eax, eax
jz	loc_45B05E
mov	[esi+1A0h], edi
jmp	loc_45AE68
; ---------------------------------------------------------------------------

loc_45AF3C:				; CODE XREF: sub_45AE60+5Bj
					; DATA XREF: .text:off_45B064o
push	esi				; jumptable 0045AEBB case 219
call	sub_45BC30
add	esp, 4
test	eax, eax
jz	loc_45B05E
mov	[esi+1A0h], edi
jmp	loc_45AE68
; ---------------------------------------------------------------------------

loc_45AF58:				; CODE XREF: sub_45AE60+5Bj
					; DATA XREF: .text:off_45B064o
push	esi				; jumptable 0045AEBB case 221
call	sub_45BEC0
add	esp, 4
test	eax, eax
jz	loc_45B05E
mov	[esi+1A0h], edi
jmp	loc_45AE68
; ---------------------------------------------------------------------------

loc_45AF74:				; CODE XREF: sub_45AE60+5Bj
					; DATA XREF: .text:off_45B064o
mov	ecx, [esi+1B8h]			; jumptable 0045AEBB cases 224-239
push	esi
call	dword ptr [ecx+eax*4-360h]
add	esp, 4
test	eax, eax
jz	loc_45B05E
mov	[esi+1A0h], edi
jmp	loc_45AE68
; ---------------------------------------------------------------------------

loc_45AF98:				; CODE XREF: sub_45AE60+5Bj
					; DATA XREF: .text:off_45B064o
mov	edx, [esi+1B8h]			; jumptable 0045AEBB case 254
push	esi
call	dword ptr [edx+1Ch]
add	esp, 4
test	eax, eax
jz	loc_45B05E
mov	[esi+1A0h], edi
jmp	loc_45AE68
; ---------------------------------------------------------------------------

loc_45AFB8:				; CODE XREF: sub_45AE60+5Bj
					; DATA XREF: .text:off_45B064o
mov	eax, [esi]			; jumptable 0045AEBB cases 1,208-215
push	1
push	esi
mov	dword ptr [eax+14h], 5Ch
mov	ecx, [esi]
mov	edx, [esi+1A0h]
mov	[ecx+18h], edx
mov	eax, [esi]
call	dword ptr [eax+4]
add	esp, 8
mov	[esi+1A0h], edi
jmp	loc_45AE68
; ---------------------------------------------------------------------------

loc_45AFE2:				; CODE XREF: sub_45AE60+5Bj
					; DATA XREF: .text:off_45B064o
push	esi				; jumptable 0045AEBB cases 204,220
call	sub_45ADB0
add	esp, 4
test	eax, eax
jz	short loc_45B05E
mov	[esi+1A0h], edi
jmp	loc_45AE68
; ---------------------------------------------------------------------------

loc_45AFFA:				; CODE XREF: sub_45AE60+4Dj
					; sub_45AE60+5Bj
					; DATA XREF: ...
mov	ecx, [esi]			; jumptable 0045AEBB default case
push	esi
mov	dword ptr [ecx+14h], 44h
mov	edx, [esi]
mov	eax, [esi+1A0h]
mov	[edx+18h], eax
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4
mov	[esi+1A0h], edi
jmp	loc_45AE68
; ---------------------------------------------------------------------------

loc_45B021:				; CODE XREF: sub_45AE60+5Bj
					; DATA XREF: .text:off_45B064o
push	esi				; jumptable 0045AEBB case 218
call	sub_45B5A0
add	esp, 4
test	eax, eax
jz	short loc_45B05E
mov	[esi+1A0h], edi
pop	edi
mov	eax, 1
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45B03C:				; CODE XREF: sub_45AE60+5Bj
					; DATA XREF: .text:off_45B064o
mov	edx, [esi]			; jumptable 0045AEBB case 217
push	1
push	esi
mov	dword ptr [edx+14h], 55h
mov	eax, [esi]
call	dword ptr [eax+4]
add	esp, 8
mov	[esi+1A0h], edi
mov	eax, 2
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45B05E:				; CODE XREF: sub_45AE60+26j
					; sub_45AE60+38j ...
pop	edi
xor	eax, eax
pop	esi
retn
; ---------------------------------------------------------------------------
align 4
off_45B064 dd offset loc_45AFB8, offset	loc_45AECD, offset loc_45AED1, offset loc_45AEF9
					; DATA XREF: sub_45AE60+5Br
dd offset loc_45AF20, offset loc_45AED4, offset	loc_45AED9, offset loc_45AFE2 ;	jump table for switch statement
dd offset loc_45AEC2, offset loc_45B03C, offset	loc_45B021, offset loc_45AF3C
dd offset loc_45AF58, offset loc_45AF74, offset	loc_45AF98, offset loc_45AFFA
byte_45B0A4 db 0, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh
					; DATA XREF: sub_45AE60+55r
db 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh	; indirect table for switch statement
db 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh
db 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh
db 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh
db 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh
db 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh
db 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh
db 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh
db 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh
db 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh
db 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh
db 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh
db 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh,	1, 1, 2, 3, 4, 3, 3, 3
db 3, 5, 6, 3, 7, 3, 3,	3, 0, 0, 0, 0, 0, 0, 0,	0, 8, 9, 0Ah, 0Bh, 7, 0Ch
db 0Fh,	0Fh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh
db 0Dh,	0Dh, 0Dh, 0Dh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh,	0Fh, 0Fh, 0Fh, 0Fh, 0Fh
db 0Fh,	0Fh, 0Fh, 0Fh, 0Eh
sub_45AE60 endp

align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45B1B0 proc	near			; CODE XREF: sub_45AE60+63p

arg_0= dword ptr  4

push	ebx
push	ebp
push	esi
mov	esi, [esp+0Ch+arg_0]
push	1
push	esi
mov	eax, [esi]
mov	dword ptr [eax+14h], 66h
mov	ecx, [esi]
call	dword ptr [ecx+4]
mov	edx, [esi+1B8h]
xor	ebx, ebx
add	esp, 8
cmp	[edx+0Ch], ebx
jz	short loc_45B1E9
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 3Dh
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4

loc_45B1E9:				; CODE XREF: sub_45B1B0+26j
mov	ecx, 0FFFFFF0Ch
lea	eax, [esi+0F4h]
sub	ecx, esi
mov	dl, 5

loc_45B1F8:				; CODE XREF: sub_45B1B0+58j
mov	[eax-10h], bl
mov	byte ptr [eax],	1
mov	[eax+10h], dl
inc	eax
lea	ebp, [ecx+eax]
cmp	ebp, 10h
jl	short loc_45B1F8
mov	edx, [esi+1B8h]
mov	[esi+114h], ebx
mov	[esi+28h], ebx
mov	[esi+12Ch], ebx
mov	[esi+118h], ebx
mov	byte ptr [esi+11Ch], 1
mov	byte ptr [esi+11Dh], 1
mov	[esi+11Eh], bl
mov	word ptr [esi+120h], 1
mov	word ptr [esi+122h], 1
mov	[esi+124h], ebx
mov	[esi+128h], bl
pop	esi
pop	ebp
mov	dword ptr [edx+0Ch], 1
mov	eax, 1
pop	ebx
retn
sub_45B1B0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45B270 proc	near			; CODE XREF: sub_45AE60+7Ep

var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

push	ecx
push	ebx
push	ebp
push	esi
mov	esi, [esp+10h+arg_0]
mov	eax, [esp+10h+arg_4]
mov	ecx, [esp+10h+arg_8]
mov	ebp, [esi+18h]
push	edi
mov	[esp+14h+var_4], ebp
mov	ebx, [ebp+4]
mov	edi, [ebp+0]
test	ebx, ebx
mov	[esi+0DCh], eax
mov	[esi+0E0h], ecx
jnz	short loc_45B2B3
push	esi
call	dword ptr [ebp+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B58F
mov	edi, [ebp+0]
mov	ebx, [ebp+4]

loc_45B2B3:				; CODE XREF: sub_45B270+2Cj
xor	edx, edx
dec	ebx
mov	dh, [edi]
inc	edi
test	ebx, ebx
mov	[esp+14h+arg_0], edx
jnz	short loc_45B2D6
push	esi
call	dword ptr [ebp+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B58F
mov	edi, [ebp+0]
mov	ebx, [ebp+4]

loc_45B2D6:				; CODE XREF: sub_45B270+4Fj
mov	ecx, [esp+14h+arg_0]
xor	eax, eax
mov	al, [edi]
dec	ebx
add	ecx, eax
inc	edi
test	ebx, ebx
mov	[esp+14h+arg_0], ecx
jnz	short loc_45B2FF
push	esi
call	dword ptr [ebp+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B58F
mov	edi, [ebp+0]
mov	ebx, [ebp+4]

loc_45B2FF:				; CODE XREF: sub_45B270+78j
xor	ecx, ecx
dec	ebx
mov	cl, [edi]
inc	edi
test	ebx, ebx
mov	[esi+0D4h], ecx
jnz	short loc_45B324
push	esi
call	dword ptr [ebp+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B58F
mov	edi, [ebp+0]
mov	ebx, [ebp+4]

loc_45B324:				; CODE XREF: sub_45B270+9Dj
xor	edx, edx
dec	ebx
mov	dh, [edi]
inc	edi
test	ebx, ebx
mov	[esi+20h], edx
jnz	short loc_45B346
push	esi
call	dword ptr [ebp+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B58F
mov	edi, [ebp+0]
mov	ebx, [ebp+4]

loc_45B346:				; CODE XREF: sub_45B270+BFj
mov	ecx, [esi+20h]
xor	eax, eax
mov	al, [edi]
dec	ebx
add	ecx, eax
inc	edi
test	ebx, ebx
mov	[esi+20h], ecx
jnz	short loc_45B36D
push	esi
call	dword ptr [ebp+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B58F
mov	edi, [ebp+0]
mov	ebx, [ebp+4]

loc_45B36D:				; CODE XREF: sub_45B270+E6j
xor	ecx, ecx
dec	ebx
mov	ch, [edi]
inc	edi
test	ebx, ebx
mov	[esi+1Ch], ecx
jnz	short loc_45B38F
push	esi
call	dword ptr [ebp+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B58F
mov	edi, [ebp+0]
mov	ebx, [ebp+4]

loc_45B38F:				; CODE XREF: sub_45B270+108j
mov	ecx, [esi+1Ch]
xor	edx, edx
mov	dl, [edi]
dec	ebx
add	ecx, edx
inc	edi
test	ebx, ebx
mov	[esi+1Ch], ecx
jnz	short loc_45B3B6
push	esi
call	dword ptr [ebp+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B58F
mov	edi, [ebp+0]
mov	ebx, [ebp+4]

loc_45B3B6:				; CODE XREF: sub_45B270+12Fj
mov	edx, [esp+14h+arg_0]
xor	eax, eax
mov	al, [edi]
mov	ecx, [esi+1A0h]
mov	[esi+24h], eax
mov	eax, [esi]
add	eax, 18h
sub	edx, 8
mov	[esp+14h+arg_0], edx
push	1
mov	[eax], ecx
mov	edx, [esi+1Ch]
mov	[eax+4], edx
mov	ecx, [esi+20h]
mov	[eax+8], ecx
mov	edx, [esi+24h]
mov	[eax+0Ch], edx
mov	eax, [esi]
dec	ebx
push	esi
mov	dword ptr [eax+14h], 64h
mov	ecx, [esi]
inc	edi
call	dword ptr [ecx+4]
mov	edx, [esi+1B8h]
add	esp, 8
mov	eax, [edx+10h]
test	eax, eax
jz	short loc_45B41B
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 3Ah
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4

loc_45B41B:				; CODE XREF: sub_45B270+198j
mov	eax, [esi+20h]
test	eax, eax
jbe	short loc_45B430
mov	eax, [esi+1Ch]
test	eax, eax
jbe	short loc_45B430
mov	eax, [esi+24h]
test	eax, eax
jg	short loc_45B441

loc_45B430:				; CODE XREF: sub_45B270+1B0j
					; sub_45B270+1B7j
mov	edx, [esi]
push	esi
mov	dword ptr [edx+14h], 20h
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4

loc_45B441:				; CODE XREF: sub_45B270+1BEj
mov	eax, [esi+24h]
lea	ecx, [eax+eax*2]
mov	eax, [esp+14h+arg_0]
cmp	eax, ecx
jz	short loc_45B460
mov	edx, [esi]
push	esi
mov	dword ptr [edx+14h], 0Bh
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4

loc_45B460:				; CODE XREF: sub_45B270+1DDj
mov	eax, [esi+0D8h]
test	eax, eax
jnz	short loc_45B48E
mov	ecx, [esi+24h]
mov	edx, [esi+4]
lea	eax, ds:0[ecx*8]
sub	eax, ecx
lea	eax, [eax+eax*2]
shl	eax, 2
push	eax
push	1
push	esi
call	dword ptr [edx]
add	esp, 0Ch
mov	[esi+0D8h], eax

loc_45B48E:				; CODE XREF: sub_45B270+1F8j
mov	eax, [esi+24h]
mov	ebp, [esi+0D8h]
test	eax, eax
mov	[esp+14h+arg_0], 0
jle	loc_45B56E

loc_45B4A7:				; CODE XREF: sub_45B270+2F8j
mov	ecx, [esp+14h+arg_0]
test	ebx, ebx
mov	[ebp+4], ecx
jnz	short loc_45B4CA
mov	ebx, [esp+14h+var_4]
push	esi
call	dword ptr [ebx+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B58F
mov	edi, [ebx]
mov	ebx, [ebx+4]

loc_45B4CA:				; CODE XREF: sub_45B270+240j
xor	edx, edx
dec	ebx
mov	dl, [edi]
inc	edi
test	ebx, ebx
mov	[ebp+0], edx
jnz	short loc_45B4EF
mov	ebx, [esp+14h+var_4]
push	esi
call	dword ptr [ebx+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B58F
mov	edi, [ebx]
mov	ebx, [ebx+4]

loc_45B4EF:				; CODE XREF: sub_45B270+265j
xor	eax, eax
dec	ebx
mov	al, [edi]
inc	edi
mov	ecx, eax
and	eax, 0Fh
sar	ecx, 4
and	ecx, 0Fh
mov	[ebp+0Ch], eax
test	ebx, ebx
mov	[ebp+8], ecx
jnz	short loc_45B51E
mov	ebx, [esp+14h+var_4]
push	esi
call	dword ptr [ebx+0Ch]
add	esp, 4
test	eax, eax
jz	short loc_45B58F
mov	edi, [ebx]
mov	ebx, [ebx+4]

loc_45B51E:				; CODE XREF: sub_45B270+298j
xor	edx, edx
push	1
mov	dl, [edi]
dec	ebx
mov	[ebp+10h], edx
mov	eax, [esi]
mov	ecx, [ebp+0]
add	eax, 18h
push	esi
inc	edi
mov	[eax], ecx
mov	edx, [ebp+8]
mov	[eax+4], edx
mov	ecx, [ebp+0Ch]
mov	[eax+8], ecx
mov	edx, [ebp+10h]
mov	[eax+0Ch], edx
mov	eax, [esi]
mov	dword ptr [eax+14h], 65h
mov	ecx, [esi]
call	dword ptr [ecx+4]
mov	eax, [esp+1Ch+arg_0]
mov	ecx, [esi+24h]
add	esp, 8
inc	eax
add	ebp, 54h
cmp	eax, ecx
mov	[esp+14h+arg_0], eax
jl	loc_45B4A7

loc_45B56E:				; CODE XREF: sub_45B270+231j
mov	edx, [esi+1B8h]
mov	eax, [esp+14h+var_4]
mov	dword ptr [edx+10h], 1
mov	[eax], edi
pop	edi
pop	esi
mov	[eax+4], ebx
pop	ebp
mov	eax, 1
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_45B58F:				; CODE XREF: sub_45B270+37j
					; sub_45B270+5Aj ...
pop	edi
pop	esi
pop	ebp
xor	eax, eax
pop	ebx
pop	ecx
retn
sub_45B270 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45B5A0 proc	near			; CODE XREF: sub_45AE60+1C2p

var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4

sub	esp, 14h
push	ebx
push	ebp
push	esi
mov	esi, [esp+20h+arg_0]
push	edi
mov	eax, [esi+1B8h]
mov	edi, [esi+18h]
mov	[esp+24h+var_4], edi
mov	ecx, [eax+10h]
mov	ebp, [edi]
mov	ebx, [edi+4]
test	ecx, ecx
jnz	short loc_45B5D5
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 3Eh
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4

loc_45B5D5:				; CODE XREF: sub_45B5A0+22j
test	ebx, ebx
jnz	short loc_45B5F3
push	esi
call	dword ptr [edi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B8AE
mov	eax, [edi+4]
mov	ebp, [edi]
mov	[esp+24h+arg_0], eax
mov	ebx, eax

loc_45B5F3:				; CODE XREF: sub_45B5A0+37j
xor	ecx, ecx
dec	ebx
mov	ch, [ebp+0]
inc	ebp
test	ebx, ebx
mov	[esp+24h+var_14], ecx
jnz	short loc_45B61C
push	esi
call	dword ptr [edi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B8AE
mov	edx, [edi+4]
mov	ebp, [edi]
mov	[esp+24h+arg_0], edx
mov	ebx, edx

loc_45B61C:				; CODE XREF: sub_45B5A0+60j
mov	ecx, [esp+24h+var_14]
xor	eax, eax
mov	al, [ebp+0]
dec	ebx
add	ecx, eax
inc	ebp
test	ebx, ebx
mov	[esp+24h+var_14], ecx
jnz	short loc_45B64B
push	esi
call	dword ptr [edi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B8AE
mov	ecx, [edi+4]
mov	ebp, [edi]
mov	[esp+24h+arg_0], ecx
mov	ebx, ecx

loc_45B64B:				; CODE XREF: sub_45B5A0+8Fj
mov	edx, [esi]
xor	eax, eax
mov	al, [ebp+0]
push	1
mov	dword ptr [edx+14h], 67h
mov	ecx, [esi]
dec	ebx
push	esi
mov	[ecx+18h], eax
mov	edx, [esi]
mov	[esp+2Ch+var_C], eax
inc	ebp
call	dword ptr [edx+4]
mov	eax, [esp+2Ch+var_C]
mov	edx, [esp+2Ch+var_14]
add	esp, 8
lea	ecx, [eax+eax+6]
cmp	edx, ecx
jnz	short loc_45B689
cmp	eax, 1
jl	short loc_45B689
cmp	eax, 4
jle	short loc_45B69E

loc_45B689:				; CODE XREF: sub_45B5A0+DDj
					; sub_45B5A0+E2j
mov	edx, [esi]
push	esi
mov	dword ptr [edx+14h], 0Bh
mov	eax, [esi]
call	dword ptr [eax]
mov	eax, [esp+28h+var_C]
add	esp, 4

loc_45B69E:				; CODE XREF: sub_45B5A0+E7j
test	eax, eax
mov	[esi+148h], eax
mov	[esp+24h+var_8], 0
jle	loc_45B7B4
lea	ecx, [esi+14Ch]
mov	[esp+24h+var_10], ecx

loc_45B6BE:				; CODE XREF: sub_45B5A0+20Ej
test	ebx, ebx
jnz	short loc_45B6DC
push	esi
call	dword ptr [edi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B8AE
mov	edx, [edi+4]
mov	ebp, [edi]
mov	[esp+24h+arg_0], edx
mov	ebx, edx

loc_45B6DC:				; CODE XREF: sub_45B5A0+120j
xor	eax, eax
dec	ebx
mov	al, [ebp+0]
inc	ebp
test	ebx, ebx
mov	[esp+24h+var_14], eax
jnz	short loc_45B705
push	esi
call	dword ptr [edi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B8AE
mov	ecx, [edi+4]
mov	ebp, [edi]
mov	[esp+24h+arg_0], ecx
mov	ebx, ecx

loc_45B705:				; CODE XREF: sub_45B5A0+149j
mov	ecx, [esi+24h]
dec	ebx
mov	edi, [esi+0D8h]
mov	[esp+24h+arg_0], ebx
xor	ebx, ebx
xor	eax, eax
mov	bl, [ebp+0]
inc	ebp
test	ecx, ecx
jle	short loc_45B72F

loc_45B71F:				; CODE XREF: sub_45B5A0+18Dj
mov	edx, [esp+24h+var_14]
cmp	edx, [edi]
jz	short loc_45B749
inc	eax
add	edi, 54h
cmp	eax, ecx
jl	short loc_45B71F

loc_45B72F:				; CODE XREF: sub_45B5A0+17Dj
mov	eax, [esi]
mov	edx, [esp+24h+var_14]
push	esi
mov	dword ptr [eax+14h], 5
mov	ecx, [esi]
mov	[ecx+18h], edx
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4

loc_45B749:				; CODE XREF: sub_45B5A0+185j
mov	ecx, [esp+24h+var_10]
mov	edx, ebx
sar	edx, 4
and	edx, 0Fh
and	ebx, 0Fh
mov	[ecx], edi
mov	ecx, [esp+24h+var_14]
mov	[edi+14h], edx
mov	[edi+18h], ebx
mov	eax, [esi]
mov	[eax+18h], ecx
mov	edx, [edi+14h]
add	eax, 18h
push	1
push	esi
mov	[eax+4], edx
mov	ecx, [edi+18h]
mov	[eax+8], ecx
mov	edx, [esi]
mov	dword ptr [edx+14h], 68h
mov	eax, [esi]
call	dword ptr [eax+4]
mov	eax, [esp+2Ch+var_8]
mov	edx, [esp+2Ch+var_10]
mov	ecx, [esp+2Ch+var_C]
mov	edi, [esp+2Ch+var_4]
mov	ebx, [esp+2Ch+arg_0]
add	esp, 8
inc	eax
add	edx, 4
cmp	eax, ecx
mov	[esp+24h+var_8], eax
mov	[esp+24h+var_10], edx
jl	loc_45B6BE

loc_45B7B4:				; CODE XREF: sub_45B5A0+10Ej
test	ebx, ebx
jnz	short loc_45B7D2
push	esi
call	dword ptr [edi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B8AE
mov	ecx, [edi+4]
mov	ebp, [edi]
mov	[esp+24h+arg_0], ecx
mov	ebx, ecx

loc_45B7D2:				; CODE XREF: sub_45B5A0+216j
xor	eax, eax
dec	ebx
mov	al, [ebp+0]
inc	ebp
test	ebx, ebx
mov	[esi+190h], eax
jnz	short loc_45B7FD
push	esi
call	dword ptr [edi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B8AE
mov	edx, [edi+4]
mov	ebp, [edi]
mov	[esp+24h+arg_0], edx
mov	ebx, edx

loc_45B7FD:				; CODE XREF: sub_45B5A0+241j
xor	eax, eax
dec	ebx
mov	al, [ebp+0]
inc	ebp
test	ebx, ebx
mov	[esi+194h], eax
jnz	short loc_45B828
push	esi
call	dword ptr [edi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45B8AE
mov	eax, [edi+4]
mov	ebp, [edi]
mov	[esp+24h+arg_0], eax
mov	ebx, eax

loc_45B828:				; CODE XREF: sub_45B5A0+26Cj
xor	eax, eax
mov	edx, [esi+190h]
mov	al, [ebp+0]
push	1
mov	ecx, eax
and	eax, 0Fh
mov	[esi+19Ch], eax
mov	eax, [esi]
sar	ecx, 4
and	ecx, 0Fh
add	eax, 18h
mov	[esi+198h], ecx
push	esi
mov	[eax], edx
mov	ecx, [esi+194h]
mov	[eax+4], ecx
mov	edx, [esi+198h]
mov	[eax+8], edx
mov	ecx, [esi+19Ch]
mov	[eax+0Ch], ecx
mov	edx, [esi]
mov	dword ptr [edx+14h], 69h
mov	eax, [esi]
call	dword ptr [eax+4]
mov	ecx, [esi+1B8h]
add	esp, 8
mov	dword ptr [ecx+14h], 0
mov	eax, [esi+90h]
inc	eax
inc	ebp
dec	ebx
mov	[esi+90h], eax
mov	[edi], ebp
mov	[edi+4], ebx
pop	edi
pop	esi
pop	ebp
mov	eax, 1
pop	ebx
add	esp, 14h
retn
; ---------------------------------------------------------------------------

loc_45B8AE:				; CODE XREF: sub_45B5A0+42j
					; sub_45B5A0+6Bj ...
pop	edi
pop	esi
pop	ebp
xor	eax, eax
pop	ebx
add	esp, 14h
retn
sub_45B5A0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45B8C0 proc	near			; CODE XREF: sub_45AE60+C1p

var_128= dword ptr -128h
var_124= dword ptr -124h
var_120= dword ptr -120h
var_11C= dword ptr -11Ch
var_118= dword ptr -118h
var_113= dword ptr -113h
var_10F= dword ptr -10Fh
var_10B= dword ptr -10Bh
var_104= dword ptr -104h
var_100= byte ptr -100h
arg_0= dword ptr  4

sub	esp, 128h
push	ebx
push	ebp
mov	ebp, [esp+130h+arg_0]
push	esi
push	edi
mov	edi, [ebp+18h]
mov	[esp+138h+var_11C], edi
mov	esi, [edi+4]
mov	ebx, [edi]
test	esi, esi
jnz	short loc_45B8FB
push	ebp
call	dword ptr [edi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45BC18
mov	eax, [edi+4]
mov	ebx, [edi]
mov	[esp+138h+var_128], eax
mov	esi, eax

loc_45B8FB:				; CODE XREF: sub_45B8C0+1Fj
xor	eax, eax
dec	esi
mov	ah, [ebx]
inc	ebx
test	esi, esi
mov	[esp+138h+var_124], eax
jnz	short loc_45B927
push	ebp
call	dword ptr [edi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45BC18
mov	ecx, [edi+4]
mov	ebx, [edi]
mov	eax, [esp+138h+var_124]
mov	[esp+138h+var_128], ecx
mov	esi, ecx

loc_45B927:				; CODE XREF: sub_45B8C0+47j
xor	edx, edx
dec	esi
mov	dl, [ebx]
add	eax, edx
inc	ebx
sub	eax, 2
cmp	eax, 10h
mov	[esp+138h+var_124], eax
jle	loc_45BBEC

loc_45B93F:				; CODE XREF: sub_45B8C0+326j
test	esi, esi
jnz	short loc_45B95D
push	ebp
call	dword ptr [edi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45BC18
mov	eax, [edi+4]
mov	ebx, [edi]
mov	[esp+138h+var_128], eax
mov	esi, eax

loc_45B95D:				; CODE XREF: sub_45B8C0+81j
mov	ecx, [ebp+0]
xor	eax, eax
mov	al, [ebx]
push	1
mov	dword ptr [ecx+14h], 50h
mov	edx, [ebp+0]
mov	[esp+13Ch+var_104], eax
dec	esi
mov	[edx+18h], eax
mov	eax, [ebp+0]
push	ebp
inc	ebx
call	dword ptr [eax+4]
add	esp, 8
mov	byte ptr [esp+138h+var_118], 0
mov	[esp+138h+var_120], 0
mov	edi, 1

loc_45B995:				; CODE XREF: sub_45B8C0+115j
test	esi, esi
jnz	short loc_45B9B7
mov	esi, [esp+138h+var_11C]
push	ebp
call	dword ptr [esi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45BC18
mov	ecx, [esi+4]
mov	ebx, [esi]
mov	[esp+138h+var_128], ecx
mov	esi, ecx

loc_45B9B7:				; CODE XREF: sub_45B8C0+D7j
mov	dl, [ebx]
xor	eax, eax
mov	byte ptr [esp+edi+138h+var_118], dl
mov	al, dl
mov	edx, [esp+138h+var_120]
dec	esi
inc	ebx
add	edx, eax
inc	edi
mov	[esp+138h+var_128], esi
cmp	edi, 10h
mov	[esp+138h+var_120], edx
jle	short loc_45B995
mov	eax, [esp+138h+var_124]
mov	ecx, [esp+138h+var_118+1]
mov	edx, [esp+138h+var_118+2]
sub	eax, 11h
mov	[esp+138h+var_124], eax
mov	eax, [ebp+0]
add	eax, 18h
and	ecx, 0FFh
and	edx, 0FFh
mov	edi, 56h
mov	[eax], ecx
mov	ecx, [esp+138h+var_118+3]
mov	[eax+4], edx
mov	edx, [esp+24h]
and	ecx, 0FFh
and	edx, 0FFh
mov	[eax+8], ecx
mov	ecx, [esp+138h+var_113]
mov	[eax+0Ch], edx
mov	edx, [esp+138h+var_113+1]
and	ecx, 0FFh
and	edx, 0FFh
mov	[eax+10h], ecx
mov	ecx, [esp+138h+var_113+2]
mov	[eax+14h], edx
mov	edx, [esp+138h+var_113+3]
and	ecx, 0FFh
and	edx, 0FFh
mov	[eax+18h], ecx
mov	[eax+1Ch], edx
mov	eax, [ebp+0]
push	2
push	ebp
mov	[eax+14h], edi
mov	ecx, [ebp+0]
call	dword ptr [ecx+4]
mov	eax, [ebp+0]
mov	edx, [esp+140h+var_10F]
mov	ecx, [esp+140h+var_10F+1]
add	eax, 18h
and	edx, 0FFh
and	ecx, 0FFh
mov	[eax], edx
mov	edx, [esp+140h+var_10F+2]
mov	[eax+4], ecx
mov	ecx, [esp+140h+var_10F+3]
and	edx, 0FFh
and	ecx, 0FFh
mov	[eax+8], edx
mov	edx, [esp+140h+var_10B]
mov	[eax+0Ch], ecx
mov	ecx, [esp+140h+var_10B+1]
and	edx, 0FFh
and	ecx, 0FFh
mov	[eax+10h], edx
mov	edx, [esp+140h+var_10B+2]
mov	[eax+14h], ecx
mov	ecx, [esp+140h+var_10B+3]
and	edx, 0FFh
and	ecx, 0FFh
mov	[eax+18h], edx
mov	[eax+1Ch], ecx
mov	edx, [ebp+0]
push	2
push	ebp
mov	[edx+14h], edi
mov	eax, [ebp+0]
call	dword ptr [eax+4]
mov	edi, [esp+148h+var_120]
add	esp, 10h
cmp	edi, 100h
jg	short loc_45BAF4
cmp	edi, [esp+138h+var_124]
jle	short loc_45BB07

loc_45BAF4:				; CODE XREF: sub_45B8C0+22Cj
mov	ecx, [ebp+0]
push	ebp
mov	dword ptr [ecx+14h], 8
mov	edx, [ebp+0]
call	dword ptr [edx]
add	esp, 4

loc_45BB07:				; CODE XREF: sub_45B8C0+232j
xor	eax, eax
test	edi, edi
mov	[esp+138h+var_120], eax
jle	short loc_45BB4C

loc_45BB11:				; CODE XREF: sub_45B8C0+28Aj
test	esi, esi
jnz	short loc_45BB37
mov	esi, [esp+138h+var_11C]
push	ebp
call	dword ptr [esi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45BC18
mov	eax, [esi+4]
mov	ebx, [esi]
mov	[esp+138h+var_128], eax
mov	esi, eax
mov	eax, [esp+138h+var_120]

loc_45BB37:				; CODE XREF: sub_45B8C0+253j
mov	cl, [ebx]
dec	esi
mov	[esp+eax+138h+var_100],	cl
inc	ebx
inc	eax
mov	[esp+138h+var_128], esi
cmp	eax, edi
mov	[esp+138h+var_120], eax
jl	short loc_45BB11

loc_45BB4C:				; CODE XREF: sub_45B8C0+24Fj
mov	edx, [esp+138h+var_124]
mov	eax, [esp+138h+var_104]
sub	edx, edi
test	al, 10h
mov	[esp+138h+var_124], edx
jz	short loc_45BB6A
sub	eax, 10h
lea	esi, [ebp+eax*4+0C4h]
jmp	short loc_45BB71
; ---------------------------------------------------------------------------

loc_45BB6A:				; CODE XREF: sub_45B8C0+29Cj
lea	esi, [ebp+eax*4+0B4h]

loc_45BB71:				; CODE XREF: sub_45B8C0+2A8j
test	eax, eax
jl	short loc_45BB7A
cmp	eax, 4
jl	short loc_45BB93

loc_45BB7A:				; CODE XREF: sub_45B8C0+2B3j
mov	edx, [ebp+0]
push	ebp
mov	dword ptr [edx+14h], 1Eh
mov	ecx, [ebp+0]
mov	[ecx+18h], eax
mov	edx, [ebp+0]
call	dword ptr [edx]
add	esp, 4

loc_45BB93:				; CODE XREF: sub_45B8C0+2B8j
cmp	dword ptr [esi], 0
jnz	short loc_45BBA3
push	ebp
call	sub_459670
add	esp, 4
mov	[esi], eax

loc_45BBA3:				; CODE XREF: sub_45B8C0+2D6j
mov	eax, [esi]
mov	ecx, [esp+138h+var_118]
mov	edx, [esp+24h]
mov	[eax], ecx
mov	ecx, [esp+138h+var_113+3]
mov	[eax+4], edx
mov	edx, [esp+138h+var_10F+3]
mov	[eax+8], ecx
mov	cl, byte ptr [esp+138h+var_10B+3]
mov	[eax+0Ch], edx
mov	[eax+10h], cl
mov	edi, [esi]
mov	eax, [esp+138h+var_124]
add	edi, 11h
mov	ecx, 40h
lea	esi, [esp+138h+var_100]
rep movsd
mov	esi, [esp+138h+var_128]
mov	edi, [esp+138h+var_11C]
cmp	eax, 10h
jg	loc_45B93F

loc_45BBEC:				; CODE XREF: sub_45B8C0+79j
test	eax, eax
jz	short loc_45BC03
mov	edx, [ebp+0]
push	ebp
mov	dword ptr [edx+14h], 0Bh
mov	eax, [ebp+0]
call	dword ptr [eax]
add	esp, 4

loc_45BC03:				; CODE XREF: sub_45B8C0+32Ej
mov	[edi], ebx
mov	[edi+4], esi
pop	edi
pop	esi
pop	ebp
mov	eax, 1
pop	ebx
add	esp, 128h
retn
; ---------------------------------------------------------------------------

loc_45BC18:				; CODE XREF: sub_45B8C0+2Aj
					; sub_45B8C0+52j ...
pop	edi
pop	esi
pop	ebp
xor	eax, eax
pop	ebx
add	esp, 128h
retn
sub_45B8C0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45BC30 proc	near			; CODE XREF: sub_45AE60+DDp

var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4

sub	esp, 14h
push	ebx
push	ebp
push	esi
push	edi
mov	edi, [esp+24h+arg_0]
mov	esi, [edi+18h]
mov	[esp+24h+var_14], esi
mov	ebp, [esi+4]
mov	ebx, [esi]
test	ebp, ebp
jnz	short loc_45BC5F
push	edi
call	dword ptr [esi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45BEAE
mov	ebx, [esi]
mov	ebp, [esi+4]

loc_45BC5F:				; CODE XREF: sub_45BC30+19j
xor	eax, eax
dec	ebp
mov	ah, [ebx]
inc	ebx
test	ebp, ebp
mov	[esp+24h+arg_0], eax
jnz	short loc_45BC85
push	edi
call	dword ptr [esi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45BEAE
mov	ebx, [esi]
mov	ebp, [esi+4]
mov	eax, [esp+24h+arg_0]

loc_45BC85:				; CODE XREF: sub_45BC30+3Bj
xor	ecx, ecx
dec	ebp
mov	cl, [ebx]
add	eax, ecx
inc	ebx
sub	eax, 2
test	eax, eax
mov	[esp+24h+arg_0], eax
jle	loc_45BE89

loc_45BC9C:				; CODE XREF: sub_45BC30+251j
test	ebp, ebp
jnz	short loc_45BCB4
push	edi
call	dword ptr [esi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45BEAE
mov	ebx, [esi]
mov	ebp, [esi+4]

loc_45BCB4:				; CODE XREF: sub_45BC30+6Ej
mov	ecx, [edi]
xor	edx, edx
mov	dl, [ebx]
push	1
mov	esi, edx
mov	dword ptr [ecx+14h], 51h
mov	edx, [edi]
mov	eax, esi
and	esi, 0Fh
dec	ebp
mov	[edx+18h], esi
mov	ecx, [edi]
sar	eax, 4
mov	[ecx+1Ch], eax
mov	edx, [edi]
push	edi
inc	ebx
mov	[esp+2Ch+var_8], eax
call	dword ptr [edx+4]
add	esp, 8
cmp	esi, 4
jl	short loc_45BD01
mov	eax, [edi]
push	edi
mov	dword ptr [eax+14h], 1Fh
mov	ecx, [edi]
mov	[ecx+18h], esi
mov	edx, [edi]
call	dword ptr [edx]
add	esp, 4

loc_45BD01:				; CODE XREF: sub_45BC30+B9j
mov	eax, [edi+esi*4+0A4h]
test	eax, eax
jnz	short loc_45BD1C
push	edi
call	sub_459650
add	esp, 4
mov	[edi+esi*4+0A4h], eax

loc_45BD1C:				; CODE XREF: sub_45BC30+DAj
mov	eax, [edi+esi*4+0A4h]
mov	esi, offset dword_479024
mov	[esp+24h+var_4], eax
mov	[esp+24h+var_C], esi

loc_45BD30:				; CODE XREF: sub_45BC30+1A5j
mov	eax, [esp+24h+var_8]
test	eax, eax
jz	short loc_45BD92
test	ebp, ebp
jnz	short loc_45BD56
mov	esi, [esp+24h+var_14]
push	edi
call	dword ptr [esi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45BEAE
mov	ebx, [esi]
mov	ebp, [esi+4]
jmp	short loc_45BD5A
; ---------------------------------------------------------------------------

loc_45BD56:				; CODE XREF: sub_45BC30+10Aj
mov	esi, [esp+24h+var_14]

loc_45BD5A:				; CODE XREF: sub_45BC30+124j
xor	ecx, ecx
dec	ebp
mov	ch, [ebx]
inc	ebx
test	ebp, ebp
mov	[esp+24h+var_10], ecx
jnz	short loc_45BD7C
push	edi
call	dword ptr [esi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45BEAE
mov	ebx, [esi]
mov	ebp, [esi+4]

loc_45BD7C:				; CODE XREF: sub_45BC30+136j
mov	ecx, [esp+24h+var_10]
mov	esi, [esp+24h+var_C]
xor	edx, edx
dec	ebp
mov	dl, [ebx]
add	ecx, edx
inc	ebx
mov	[esp+24h+var_10], ecx
jmp	short loc_45BDB9
; ---------------------------------------------------------------------------

loc_45BD92:				; CODE XREF: sub_45BC30+106j
test	ebp, ebp
jnz	short loc_45BDAF
mov	ebp, [esp+24h+var_14]
push	edi
call	dword ptr [ebp+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45BEAE
mov	ebx, [ebp+0]
mov	ebp, [ebp+4]

loc_45BDAF:				; CODE XREF: sub_45BC30+164j
xor	eax, eax
dec	ebp
mov	al, [ebx]
inc	ebx
mov	[esp+24h+var_10], eax

loc_45BDB9:				; CODE XREF: sub_45BC30+160j
mov	ecx, [esi]
mov	eax, [esp+24h+var_4]
mov	dx, word ptr [esp+24h+var_10]
add	esi, 4
cmp	esi, (offset dword_479024+100h)
mov	[eax+ecx*2], dx
mov	[esp+24h+var_C], esi
jl	loc_45BD30
mov	ecx, [edi]
cmp	dword ptr [ecx+68h], 2
jl	short loc_45BE5B
lea	esi, [eax+4]
mov	[esp+24h+var_C], 8

loc_45BDEE:				; CODE XREF: sub_45BC30+229j
mov	eax, [edi]
xor	edx, edx
mov	dx, [esi-4]
add	eax, 18h
xor	ecx, ecx
push	2
mov	[eax], edx
mov	cx, [esi-2]
xor	edx, edx
mov	[eax+4], ecx
mov	dx, [esi]
xor	ecx, ecx
mov	[eax+8], edx
mov	cx, [esi+2]
xor	edx, edx
mov	[eax+0Ch], ecx
mov	dx, [esi+4]
xor	ecx, ecx
mov	[eax+10h], edx
mov	cx, [esi+6]
xor	edx, edx
mov	[eax+14h], ecx
mov	dx, [esi+8]
xor	ecx, ecx
mov	[eax+18h], edx
mov	cx, [esi+0Ah]
mov	[eax+1Ch], ecx
mov	edx, [edi]
push	edi
mov	dword ptr [edx+14h], 5Dh
mov	eax, [edi]
call	dword ptr [eax+4]
mov	eax, [esp+2Ch+var_C]
add	esp, 8
add	esi, 10h
dec	eax
mov	[esp+24h+var_C], eax
jnz	short loc_45BDEE

loc_45BE5B:				; CODE XREF: sub_45BC30+1B1j
mov	ecx, [esp+24h+arg_0]
mov	eax, [esp+24h+var_8]
sub	ecx, 41h
test	eax, eax
mov	[esp+24h+arg_0], ecx
jz	short loc_45BE77
mov	eax, ecx
sub	eax, 40h
mov	[esp+24h+arg_0], eax

loc_45BE77:				; CODE XREF: sub_45BC30+23Cj
mov	eax, [esp+24h+arg_0]
mov	esi, [esp+24h+var_14]
test	eax, eax
jg	loc_45BC9C
test	eax, eax

loc_45BE89:				; CODE XREF: sub_45BC30+66j
jz	short loc_45BE9C
mov	ecx, [edi]
push	edi
mov	dword ptr [ecx+14h], 0Bh
mov	edx, [edi]
call	dword ptr [edx]
add	esp, 4

loc_45BE9C:				; CODE XREF: sub_45BC30:loc_45BE89j
mov	[esi], ebx
mov	[esi+4], ebp
pop	edi
pop	esi
pop	ebp
mov	eax, 1
pop	ebx
add	esp, 14h
retn
; ---------------------------------------------------------------------------

loc_45BEAE:				; CODE XREF: sub_45BC30+24j
					; sub_45BC30+46j ...
pop	edi
pop	esi
pop	ebp
xor	eax, eax
pop	ebx
add	esp, 14h
retn
sub_45BC30 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45BEC0 proc	near			; CODE XREF: sub_45AE60+F9p

arg_0= dword ptr  4

push	ebx
push	ebp
mov	ebp, [esp+8+arg_0]
push	esi
push	edi
mov	esi, [ebp+18h]
mov	edi, [esi+4]
mov	ebx, [esi]
test	edi, edi
jnz	short loc_45BEE8
push	ebp
call	dword ptr [esi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45BFA9
mov	ebx, [esi]
mov	edi, [esi+4]

loc_45BEE8:				; CODE XREF: sub_45BEC0+12j
xor	eax, eax
dec	edi
mov	ah, [ebx]
inc	ebx
test	edi, edi
mov	[esp+10h+arg_0], eax
jnz	short loc_45BF0E
push	ebp
call	dword ptr [esi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45BFA9
mov	ebx, [esi]
mov	edi, [esi+4]
mov	eax, [esp+10h+arg_0]

loc_45BF0E:				; CODE XREF: sub_45BEC0+34j
xor	ecx, ecx
dec	edi
mov	cl, [ebx]
add	eax, ecx
inc	ebx
cmp	eax, 4
jz	short loc_45BF2E
mov	edx, [ebp+0]
push	ebp
mov	dword ptr [edx+14h], 0Bh
mov	eax, [ebp+0]
call	dword ptr [eax]
add	esp, 4

loc_45BF2E:				; CODE XREF: sub_45BEC0+59j
test	edi, edi
jnz	short loc_45BF42
push	ebp
call	dword ptr [esi+0Ch]
add	esp, 4
test	eax, eax
jz	short loc_45BFA9
mov	ebx, [esi]
mov	edi, [esi+4]

loc_45BF42:				; CODE XREF: sub_45BEC0+70j
xor	ecx, ecx
dec	edi
mov	ch, [ebx]
inc	ebx
test	edi, edi
mov	[esp+10h+arg_0], ecx
jnz	short loc_45BF60
push	ebp
call	dword ptr [esi+0Ch]
add	esp, 4
test	eax, eax
jz	short loc_45BFA9
mov	ebx, [esi]
mov	edi, [esi+4]

loc_45BF60:				; CODE XREF: sub_45BEC0+8Ej
mov	eax, [esp+10h+arg_0]
xor	edx, edx
mov	dl, [ebx]
push	1
add	eax, edx
push	ebp
mov	[esp+18h+arg_0], eax
mov	eax, [ebp+0]
mov	edx, [esp+18h+arg_0]
mov	dword ptr [eax+14h], 52h
mov	ecx, [ebp+0]
mov	[ecx+18h], edx
mov	eax, [ebp+0]
call	dword ptr [eax+4]
mov	ecx, [esp+18h+arg_0]
add	esp, 8
inc	ebx
dec	edi
mov	[ebp+114h], ecx
mov	[esi+4], edi
mov	[esi], ebx
pop	edi
pop	esi
pop	ebp
mov	eax, 1
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_45BFA9:				; CODE XREF: sub_45BEC0+1Dj
					; sub_45BEC0+3Fj ...
pop	edi
pop	esi
pop	ebp
xor	eax, eax
pop	ebx
retn
sub_45BEC0 endp


; =============== S U B	R O U T	I N E =======================================


sub_45BFB0 proc	near			; CODE XREF: sub_45AE60+1Cp

arg_0= dword ptr  4

push	ebx
push	ebp
mov	ebp, [esp+8+arg_0]
push	esi
push	edi
mov	esi, [ebp+18h]
mov	edi, [esi+4]
mov	ebx, [esi]
test	edi, edi
jnz	short loc_45BFD4
push	ebp
call	dword ptr [esi+0Ch]
add	esp, 4
test	eax, eax
jz	short loc_45C047
mov	ebx, [esi]
mov	edi, [esi+4]

loc_45BFD4:				; CODE XREF: sub_45BFB0+12j
xor	ecx, ecx
dec	edi
mov	cl, [ebx]
inc	ebx
test	edi, edi
mov	[esp+10h+arg_0], ecx
jnz	short loc_45BFF6
push	ebp
call	dword ptr [esi+0Ch]
add	esp, 4
test	eax, eax
jz	short loc_45C047
mov	ebx, [esi]
mov	edi, [esi+4]
mov	ecx, [esp+10h+arg_0]

loc_45BFF6:				; CODE XREF: sub_45BFB0+30j
xor	eax, eax
dec	edi
mov	al, [ebx]
inc	ebx
cmp	ecx, 0FFh
mov	[esp+10h+arg_0], eax
jnz	short loc_45C00F
cmp	eax, 0D8h
jz	short loc_45C032

loc_45C00F:				; CODE XREF: sub_45BFB0+56j
mov	edx, [ebp+0]
push	ebp
mov	dword ptr [edx+14h], 35h
mov	edx, [ebp+0]
mov	[edx+18h], ecx
mov	ecx, [ebp+0]
mov	[ecx+1Ch], eax
mov	edx, [ebp+0]
call	dword ptr [edx]
mov	eax, [esp+14h+arg_0]
add	esp, 4

loc_45C032:				; CODE XREF: sub_45BFB0+5Dj
mov	[ebp+1A0h], eax
mov	[esi+4], edi
mov	[esi], ebx
pop	edi
pop	esi
pop	ebp
mov	eax, 1
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_45C047:				; CODE XREF: sub_45BFB0+1Dj
					; sub_45BFB0+3Bj
pop	edi
pop	esi
pop	ebp
xor	eax, eax
pop	ebx
retn
sub_45BFB0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45C050 proc	near			; DATA XREF: sub_45A880+28o

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
mov	eax, [esi+1A0h]
test	eax, eax
jnz	short loc_45C06E
push	esi
call	sub_45A770
add	esp, 4
test	eax, eax
jnz	short loc_45C06E
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45C06E:				; CODE XREF: sub_45C050+Dj
					; sub_45C050+1Aj
mov	eax, [esi+1B8h]
mov	edx, [esi+1A0h]
mov	eax, [eax+14h]
lea	ecx, [eax+0D0h]
cmp	edx, ecx
jnz	short loc_45C0CA
mov	edx, [esi]
push	3
push	esi
mov	dword ptr [edx+14h], 62h
mov	eax, [esi+1B8h]
mov	ecx, [esi]
mov	edx, [eax+14h]
mov	[ecx+18h], edx
mov	eax, [esi]
call	dword ptr [eax+4]
add	esp, 8
mov	dword ptr [esi+1A0h], 0

loc_45C0B3:				; CODE XREF: sub_45C050+87j
mov	esi, [esi+1B8h]
mov	eax, 1
mov	edx, [esi+14h]
inc	edx
and	edx, 7
mov	[esi+14h], edx
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45C0CA:				; CODE XREF: sub_45C050+35j
mov	ecx, [esi+18h]
push	eax
push	esi
call	dword ptr [ecx+14h]
add	esp, 8
test	eax, eax
jnz	short loc_45C0B3
pop	esi
retn
sub_45C050 endp

; ---------------------------------------------------------------------------
align 10h

loc_45C0E0:				; CODE XREF: sub_45A880+64p
					; DATA XREF: sub_45A880+1Bo
mov	ecx, [esp+4]
xor	edx, edx
mov	eax, [ecx+1B8h]
mov	[ecx+0D8h], edx
mov	[ecx+90h], edx
mov	[ecx+1A0h], edx
mov	[eax+0Ch], edx
mov	[eax+10h], edx
mov	[eax+18h], edx
mov	[eax+0A4h], edx
retn
; ---------------------------------------------------------------------------
align 10h
mov	edx, [esp+4]
mov	ecx, [esp+0Ch]
push	esi
push	edi
mov	eax, [edx+4]
mov	edi, [edx+1B8h]
mov	eax, [eax+30h]
sub	eax, 14h
cmp	ecx, eax
jle	short loc_45C12F
mov	ecx, eax

loc_45C12F:				; CODE XREF: .text:0045C12Bj
test	ecx, ecx
jz	short loc_45C180
mov	eax, [esp+10h]
mov	esi, offset sub_45C1F0
cmp	eax, 0E0h
jnz	short loc_45C15E
cmp	ecx, 0Eh
jnb	short loc_45C1BA
mov	ecx, 0Eh
mov	[edi+eax*4-360h], esi
mov	[edi+eax*4-31Ch], ecx
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45C15E:				; CODE XREF: .text:0045C141j
cmp	eax, 0EEh
jnz	short loc_45C19C
cmp	ecx, 0Ch
jnb	short loc_45C1BA
mov	ecx, 0Ch
mov	[edi+eax*4-360h], esi
mov	[edi+eax*4-31Ch], ecx
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45C180:				; CODE XREF: .text:0045C131j
mov	eax, [esp+10h]
mov	esi, offset sub_45ADB0
cmp	eax, 0E0h
jz	short loc_45C197
cmp	eax, 0EEh
jnz	short loc_45C19C

loc_45C197:				; CODE XREF: .text:0045C18Ej
mov	esi, offset loc_45A8F0

loc_45C19C:				; CODE XREF: .text:0045C163j
					; .text:0045C195j
cmp	eax, 0FEh
jnz	short loc_45C1AC
mov	[edi+1Ch], esi
mov	[edi+60h], ecx
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45C1AC:				; CODE XREF: .text:0045C1A1j
cmp	eax, 0E0h
jl	short loc_45C1CB
cmp	eax, 0EFh
jg	short loc_45C1CB

loc_45C1BA:				; CODE XREF: .text:0045C146j
					; .text:0045C168j
mov	[edi+eax*4-360h], esi
mov	[edi+eax*4-31Ch], ecx
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45C1CB:				; CODE XREF: .text:0045C1B1j
					; .text:0045C1B8j
mov	ecx, [edx]
push	edx
mov	dword ptr [ecx+14h], 44h
mov	ecx, [edx]
mov	[ecx+18h], eax
mov	eax, [edx]
call	dword ptr [eax]
add	esp, 4
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45C1F0 proc	near			; DATA XREF: .text:0045C137o

var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4

sub	esp, 14h
mov	ecx, [esp+14h+arg_0]
push	ebx
push	ebp
push	esi
mov	edx, [ecx+1B8h]
push	edi
mov	edi, [ecx+18h]
mov	[esp+24h+var_4], edx
mov	esi, [edx+0A4h]
mov	[esp+24h+var_8], 0
mov	eax, [edi]
mov	ebp, [edi+4]
test	esi, esi
mov	[esp+24h+var_C], edi
mov	[esp+24h+var_14], eax
jnz	loc_45C32D
test	ebp, ebp
jnz	short loc_45C251
push	ecx
call	dword ptr [edi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45C3BC
mov	eax, edi
mov	ecx, [eax]
mov	ebp, [eax+4]
mov	[esp+24h+var_14], ecx
mov	ecx, [esp+24h+arg_0]
mov	eax, [esp+24h+var_14]

loc_45C251:				; CODE XREF: sub_45C1F0+3Dj
xor	ebx, ebx
dec	ebp
mov	bh, [eax]
inc	eax
test	ebp, ebp
jnz	short loc_45C27D
push	ecx
call	dword ptr [edi+0Ch]
add	esp, 4
test	eax, eax
jz	loc_45C3BC
mov	eax, [esp+24h+var_C]
mov	ecx, [esp+24h+arg_0]
mov	edx, [eax]
mov	ebp, [eax+4]
mov	[esp+24h+var_14], edx
mov	eax, edx

loc_45C27D:				; CODE XREF: sub_45C1F0+69j
xor	edx, edx
dec	ebp
mov	dl, [eax]
add	ebx, edx
inc	eax
sub	ebx, 2
mov	[esp+24h+var_14], eax
mov	[esp+24h+var_8], ebx
js	loc_45C320
mov	eax, [ecx+1A0h]
cmp	eax, 0FEh
jnz	short loc_45C2B0
mov	eax, [esp+24h+var_4]
mov	edi, [eax+60h]
mov	[esp+24h+var_10], edi
jmp	short loc_45C2C1
; ---------------------------------------------------------------------------

loc_45C2B0:				; CODE XREF: sub_45C1F0+B1j
mov	edx, [esp+24h+var_4]
mov	eax, [edx+eax*4-31Ch]
mov	[esp+24h+var_10], eax
mov	edi, eax

loc_45C2C1:				; CODE XREF: sub_45C1F0+BEj
cmp	ebx, edi
jnb	short loc_45C2CB
mov	[esp+24h+var_10], ebx
mov	edi, ebx

loc_45C2CB:				; CODE XREF: sub_45C1F0+D3j
mov	edx, [ecx+4]
lea	eax, [edi+14h]
push	eax
push	1
push	ecx
call	dword ptr [edx+4]
mov	ecx, [esp+30h+arg_0]
mov	esi, eax
mov	eax, [esp+30h+var_4]
add	esp, 0Ch
mov	dword ptr [esi], 0
mov	dl, [ecx+1A0h]
mov	[esi+8], ebx
lea	ebx, [esi+14h]
mov	[esi+4], dl
mov	edx, [esp+24h+var_10]
mov	[esi+0Ch], edi
mov	[esi+10h], ebx
mov	[eax+0A4h], esi
mov	dword ptr [eax+0A8h], 0
mov	eax, [esp+24h+var_14]
xor	edi, edi
mov	[esp+24h+var_10], edx
jmp	short loc_45C345
; ---------------------------------------------------------------------------

loc_45C320:				; CODE XREF: sub_45C1F0+A0j
xor	ebx, ebx
mov	[esp+24h+var_10], ebx
mov	edx, ebx
jmp	loc_45C3E2
; ---------------------------------------------------------------------------

loc_45C32D:				; CODE XREF: sub_45C1F0+35j
mov	edi, [edx+0A8h]
mov	edx, [esi+0Ch]
mov	[esp+24h+var_10], edx
mov	edx, [esi+10h]
mov	ebx, edi
add	ebx, edx
mov	edx, [esp+24h+var_10]

loc_45C345:				; CODE XREF: sub_45C1F0+12Ej
cmp	edi, edx
jnb	short loc_45C3A6

loc_45C349:				; CODE XREF: sub_45C1F0+1B4j
mov	edx, [esp+24h+var_C]
test	ebp, ebp
mov	[edx], eax
mov	[edx+4], ebp
mov	edx, [esp+24h+var_4]
mov	[edx+0A8h], edi
jnz	short loc_45C384
mov	eax, [esp+24h+var_C]
push	ecx
call	dword ptr [eax+0Ch]
add	esp, 4
test	eax, eax
jz	short loc_45C3BC
mov	eax, [esp+24h+var_C]
mov	ecx, [eax]
mov	ebp, [eax+4]
mov	[esp+24h+var_14], ecx
mov	ecx, [esp+24h+arg_0]
mov	eax, [esp+24h+var_14]

loc_45C384:				; CODE XREF: sub_45C1F0+16Ej
mov	edx, [esp+24h+var_10]

loc_45C388:				; CODE XREF: sub_45C1F0+1B0j
test	ebp, ebp
jbe	short loc_45C3A2
mov	dl, [eax]
mov	[ebx], dl
mov	edx, [esp+24h+var_10]
inc	ebx
inc	eax
dec	ebp
inc	edi
cmp	edi, edx
mov	[esp+24h+var_14], eax
jnb	short loc_45C3A6
jmp	short loc_45C388
; ---------------------------------------------------------------------------

loc_45C3A2:				; CODE XREF: sub_45C1F0+19Aj
cmp	edi, edx
jb	short loc_45C349

loc_45C3A6:				; CODE XREF: sub_45C1F0+157j
					; sub_45C1F0+1AEj
test	esi, esi
jz	short loc_45C3E2
mov	edi, [ecx+130h]
test	edi, edi
jnz	short loc_45C3C6
mov	[ecx+130h], esi
jmp	short loc_45C3D6
; ---------------------------------------------------------------------------

loc_45C3BC:				; CODE XREF: sub_45C1F0+48j
					; sub_45C1F0+74j ...
pop	edi
pop	esi
pop	ebp
xor	eax, eax
pop	ebx
add	esp, 14h
retn
; ---------------------------------------------------------------------------

loc_45C3C6:				; CODE XREF: sub_45C1F0+1C2j
mov	eax, [edi]
test	eax, eax
jz	short loc_45C3D4

loc_45C3CC:				; CODE XREF: sub_45C1F0+1E2j
mov	edi, eax
mov	eax, [edi]
test	eax, eax
jnz	short loc_45C3CC

loc_45C3D4:				; CODE XREF: sub_45C1F0+1DAj
mov	[edi], esi

loc_45C3D6:				; CODE XREF: sub_45C1F0+1CAj
mov	ebx, [esi+10h]
mov	esi, [esi+8]
sub	esi, edx
mov	[esp+24h+var_8], esi

loc_45C3E2:				; CODE XREF: sub_45C1F0+138j
					; sub_45C1F0+1B8j
mov	eax, [esp+24h+var_4]
mov	dword ptr [eax+0A4h], 0
mov	eax, [ecx+1A0h]
sub	eax, 0E0h
jz	short loc_45C43D
sub	eax, 0Eh
jz	short loc_45C42E
mov	eax, [ecx]
push	1
push	ecx
mov	dword ptr [eax+14h], 5Bh
mov	eax, [ecx]
mov	esi, [ecx+1A0h]
mov	[eax+18h], esi
mov	eax, [esp+2Ch+var_8]
add	edx, eax
mov	eax, [ecx]
mov	[eax+1Ch], edx
mov	edx, [ecx]
call	dword ptr [edx+4]
add	esp, 8
jmp	short loc_45C44D
; ---------------------------------------------------------------------------

loc_45C42E:				; CODE XREF: sub_45C1F0+210j
mov	eax, [esp+24h+var_8]
push	eax
push	edx
push	ebx
push	ecx
call	sub_45ACC0
jmp	short loc_45C44A
; ---------------------------------------------------------------------------

loc_45C43D:				; CODE XREF: sub_45C1F0+20Bj
mov	eax, [esp+24h+var_8]
push	eax
push	edx
push	ebx
push	ecx
call	sub_45AA30

loc_45C44A:				; CODE XREF: sub_45C1F0+24Bj
add	esp, 10h

loc_45C44D:				; CODE XREF: sub_45C1F0+23Cj
mov	eax, [esp+24h+var_C]
mov	ecx, [esp+24h+var_14]
mov	[eax], ecx
mov	[eax+4], ebp
mov	eax, [esp+24h+var_8]
test	eax, eax
jle	short loc_45C471
mov	ecx, [esp+24h+arg_0]
push	eax
push	ecx
mov	edx, [ecx+18h]
call	dword ptr [edx+10h]
add	esp, 8

loc_45C471:				; CODE XREF: sub_45C1F0+270j
pop	edi
pop	esi
pop	ebp
mov	eax, 1
pop	ebx
add	esp, 14h
retn
sub_45C1F0 endp

; ---------------------------------------------------------------------------
align 10h
mov	eax, [esp+4]
mov	ecx, [esp+8]
cmp	ecx, 0FEh
mov	edx, [eax+1B8h]
jnz	short loc_45C49E
mov	eax, [esp+0Ch]
mov	[edx+1Ch], eax
retn
; ---------------------------------------------------------------------------

loc_45C49E:				; CODE XREF: .text:0045C494j
cmp	ecx, 0E0h
jl	short loc_45C4BA
cmp	ecx, 0EFh
jg	short loc_45C4BA
mov	eax, [esp+0Ch]
mov	[edx+ecx*4-360h], eax
retn
; ---------------------------------------------------------------------------

loc_45C4BA:				; CODE XREF: .text:0045C4A4j
					; .text:0045C4ACj
mov	edx, [eax]
push	eax
mov	dword ptr [edx+14h], 44h
mov	edx, [eax]
mov	[edx+18h], ecx
mov	ecx, [eax]
call	dword ptr [ecx]
pop	ecx
retn
; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45C4D0 proc	near			; CODE XREF: sub_45C850+Fp

arg_0= dword ptr  4

push	ebp
push	esi
mov	esi, [esp+8+arg_0]
cmp	dword ptr [esi+14h], 0CAh
jz	short loc_45C4F8
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 14h
mov	ecx, [esi]
mov	edx, [esi+14h]
mov	[ecx+18h], edx
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4

loc_45C4F8:				; CODE XREF: sub_45C4D0+Dj
mov	eax, [esi+30h]
mov	ecx, [esi+34h]
mov	ebp, 1
lea	edx, ds:0[eax*8]
cmp	edx, ecx
ja	short loc_45C535
mov	eax, [esi+1Ch]
push	8
push	eax
call	sub_45CCD0
mov	ecx, [esi+20h]
push	8
push	ecx
mov	[esi+70h], eax
call	sub_45CCD0
add	esp, 10h
mov	[esi+74h], eax
mov	[esi+13Ch], ebp
jmp	short loc_45C5B3
; ---------------------------------------------------------------------------

loc_45C535:				; CODE XREF: sub_45C4D0+3Cj
lea	edx, ds:0[eax*4]
cmp	edx, ecx
ja	short loc_45C56B
mov	eax, [esi+1Ch]
push	4
push	eax
call	sub_45CCD0
mov	ecx, [esi+20h]
push	4
push	ecx
mov	[esi+70h], eax
call	sub_45CCD0
add	esp, 10h
mov	[esi+74h], eax
mov	dword ptr [esi+13Ch], 2
jmp	short loc_45C5B3
; ---------------------------------------------------------------------------

loc_45C56B:				; CODE XREF: sub_45C4D0+6Ej
lea	edx, [eax+eax]
cmp	edx, ecx
ja	short loc_45C59D
mov	eax, [esi+1Ch]
push	2
push	eax
call	sub_45CCD0
mov	ecx, [esi+20h]
push	2
push	ecx
mov	[esi+70h], eax
call	sub_45CCD0
add	esp, 10h
mov	[esi+74h], eax
mov	dword ptr [esi+13Ch], 4
jmp	short loc_45C5B3
; ---------------------------------------------------------------------------

loc_45C59D:				; CODE XREF: sub_45C4D0+A0j
mov	edx, [esi+1Ch]
mov	eax, [esi+20h]
mov	[esi+70h], edx
mov	[esi+74h], eax
mov	dword ptr [esi+13Ch], 8

loc_45C5B3:				; CODE XREF: sub_45C4D0+63j
					; sub_45C4D0+99j ...
mov	eax, [esi+24h]
mov	ecx, [esi+0D8h]
push	ebx
push	edi
test	eax, eax
mov	[esp+10h+arg_0], 0
jle	short loc_45C625
add	ecx, 0Ch

loc_45C5CD:				; CODE XREF: sub_45C4D0+14Ej
mov	edx, [esi+13Ch]
mov	eax, edx
cmp	eax, 8
jge	short loc_45C60A
mov	edi, [esi+134h]
imul	edi, edx

loc_45C5E3:				; CODE XREF: sub_45C4D0+138j
mov	ebx, [ecx-4]
imul	ebx, eax
shl	ebx, 1
cmp	ebx, edi
jg	short loc_45C60A
mov	ebp, [ecx]
mov	ebx, [esi+138h]
imul	ebp, eax
imul	ebx, edx
shl	ebp, 1
cmp	ebp, ebx
jg	short loc_45C60A
add	eax, eax
cmp	eax, 8
jl	short loc_45C5E3

loc_45C60A:				; CODE XREF: sub_45C4D0+108j
					; sub_45C4D0+11Dj ...
mov	[ecx+18h], eax
mov	eax, [esp+10h+arg_0]
mov	edx, [esi+24h]
inc	eax
add	ecx, 54h
cmp	eax, edx
mov	[esp+10h+arg_0], eax
jl	short loc_45C5CD
mov	ebp, 1

loc_45C625:				; CODE XREF: sub_45C4D0+F8j
mov	eax, [esi+24h]
mov	edi, [esi+0D8h]
xor	ebx, ebx
test	eax, eax
jle	short loc_45C67F
add	edi, 24h

loc_45C637:				; CODE XREF: sub_45C4D0+1ADj
mov	edx, [edi-1Ch]
mov	ecx, [esi+134h]
imul	edx, [edi]
imul	edx, [esi+1Ch]
shl	ecx, 3
push	ecx
push	edx
call	sub_45CCD0
mov	ecx, [edi-18h]
mov	[edi+4], eax
imul	ecx, [edi]
imul	ecx, [esi+20h]
mov	eax, [esi+138h]
shl	eax, 3
push	eax
push	ecx
call	sub_45CCD0
add	esp, 10h
mov	[edi+8], eax
mov	eax, [esi+24h]
inc	ebx
add	edi, 54h
cmp	ebx, eax
jl	short loc_45C637

loc_45C67F:				; CODE XREF: sub_45C4D0+162j
mov	eax, [esi+2Ch]
pop	edi
dec	eax
pop	ebx
cmp	eax, 4				; switch 5 cases
ja	short loc_45C6A8		; jumptable 0045C68A default case
jmp	ds:off_45C6E4[eax*4]		; switch jump
; ---------------------------------------------------------------------------

loc_45C691:				; CODE XREF: sub_45C4D0+1BAj
					; DATA XREF: .text:off_45C6E4o
mov	[esi+78h], ebp			; jumptable 0045C68A case 0
jmp	short loc_45C6AE
; ---------------------------------------------------------------------------

loc_45C696:				; CODE XREF: sub_45C4D0+1BAj
					; DATA XREF: .text:off_45C6E4o
mov	dword ptr [esi+78h], 3		; jumptable 0045C68A cases 1,2
jmp	short loc_45C6AE
; ---------------------------------------------------------------------------

loc_45C69F:				; CODE XREF: sub_45C4D0+1BAj
					; DATA XREF: .text:off_45C6E4o
mov	dword ptr [esi+78h], 4		; jumptable 0045C68A cases 3,4
jmp	short loc_45C6AE
; ---------------------------------------------------------------------------

loc_45C6A8:				; CODE XREF: sub_45C4D0+1B8j
mov	edx, [esi+24h]			; jumptable 0045C68A default case
mov	[esi+78h], edx

loc_45C6AE:				; CODE XREF: sub_45C4D0+1C4j
					; sub_45C4D0+1CDj ...
mov	eax, [esi+54h]
test	eax, eax
mov	eax, ebp
jnz	short loc_45C6BA
mov	eax, [esi+78h]

loc_45C6BA:				; CODE XREF: sub_45C4D0+1E5j
push	esi
mov	[esi+7Ch], eax
call	sub_45C700
add	esp, 4
test	eax, eax
jz	short loc_45C6D9
mov	eax, [esi+138h]
mov	[esi+80h], eax
pop	esi
pop	ebp
retn
; ---------------------------------------------------------------------------

loc_45C6D9:				; CODE XREF: sub_45C4D0+1F8j
mov	[esi+80h], ebp
pop	esi
pop	ebp
retn
; ---------------------------------------------------------------------------
align 4
off_45C6E4 dd offset loc_45C691		; DATA XREF: sub_45C4D0+1BAr
dd offset loc_45C696			; jump table for switch	statement
dd offset loc_45C696
dd offset loc_45C69F
dd offset loc_45C69F
sub_45C4D0 endp

align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45C700 proc	near			; CODE XREF: sub_45C4D0+1EEp
					; sub_45C850+20p

arg_0= dword ptr  4

mov	edx, [esp+arg_0]
push	edi
mov	eax, [edx+4Ch]
test	eax, eax
jnz	short loc_45C77F
mov	eax, [edx+12Ch]
test	eax, eax
jnz	short loc_45C77F
mov	ecx, [edx+28h]
mov	eax, 3
cmp	ecx, eax
jnz	short loc_45C77F
cmp	[edx+24h], eax
jnz	short loc_45C77F
cmp	dword ptr [edx+2Ch], 2
jnz	short loc_45C77F
cmp	[edx+78h], eax
jnz	short loc_45C77F
mov	ecx, [edx+0D8h]
cmp	dword ptr [ecx+8], 2
jnz	short loc_45C77F
mov	edi, [ecx+5Ch]
mov	eax, 1
cmp	edi, eax
jnz	short loc_45C77F
cmp	[ecx+0B0h], eax
jnz	short loc_45C77F
cmp	dword ptr [ecx+0Ch], 2
jg	short loc_45C77F
cmp	[ecx+60h], eax
jnz	short loc_45C77F
cmp	[ecx+0B4h], eax
jnz	short loc_45C77F
mov	edx, [edx+13Ch]
mov	edi, [ecx+24h]
cmp	edi, edx
jnz	short loc_45C77F
cmp	[ecx+78h], edx
jnz	short loc_45C77F
cmp	[ecx+0CCh], edx
jz	short loc_45C781

loc_45C77F:				; CODE XREF: sub_45C700+Aj
					; sub_45C700+14j ...
xor	eax, eax

loc_45C781:				; CODE XREF: sub_45C700+7Dj
pop	edi
retn
sub_45C700 endp

; ---------------------------------------------------------------------------
align 10h
push	esi
mov	esi, [esp+8]
push	edi
mov	eax, [esi+14h]
mov	edi, [esi+1A4h]
cmp	eax, 0CFh
jz	short loc_45C7BF
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 14h
mov	ecx, [esi]
mov	edx, [esi+14h]
mov	[ecx+18h], edx
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4

loc_45C7BF:				; CODE XREF: .text:0045C7A4j
mov	eax, [esi+54h]
test	eax, eax
jz	short loc_45C7F1
mov	eax, [esi+68h]
test	eax, eax
jz	short loc_45C7F1
mov	eax, [esi+88h]
test	eax, eax
jz	short loc_45C7F1
mov	eax, [edi+18h]
push	esi
mov	[esi+1CCh], eax
call	dword ptr [eax+0Ch]
add	esp, 4
mov	dword ptr [edi+8], 0
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45C7F1:				; CODE XREF: .text:0045C7C4j
					; .text:0045C7CBj ...
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 2Eh
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45C810 proc	near			; CODE XREF: sub_458440+Fp

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	1Ch
push	1
mov	eax, [esi+4]
push	esi
call	dword ptr [eax]
mov	[esi+1A4h], eax
push	esi
mov	dword ptr [eax], offset	sub_45CAB0
mov	dword ptr [eax+4], offset loc_45CC10
mov	dword ptr [eax+8], 0
call	sub_45C850
add	esp, 10h
pop	esi
retn
sub_45C810 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45C850 proc	near			; CODE XREF: sub_45C810+2Ap

arg_0= dword ptr  4

push	ebx
push	ebp
push	esi
mov	esi, [esp+0Ch+arg_0]
push	edi
push	esi
mov	ebx, [esi+1A4h]
call	sub_45C4D0
push	esi
call	sub_45CA30
xor	edi, edi
push	esi
mov	[ebx+0Ch], edi
call	sub_45C700
mov	[ebx+10h], eax
mov	[ebx+14h], edi
mov	[ebx+18h], edi
mov	eax, [esi+54h]
add	esp, 0Ch
cmp	eax, edi
jz	short loc_45C88D
cmp	[esi+40h], edi
jnz	short loc_45C896

loc_45C88D:				; CODE XREF: sub_45C850+36j
mov	[esi+64h], edi
mov	[esi+68h], edi
mov	[esi+6Ch], edi

loc_45C896:				; CODE XREF: sub_45C850+3Bj
cmp	eax, edi
mov	ebp, 1
jz	short loc_45C919
cmp	[esi+44h], edi
jz	short loc_45C8B5
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 2Fh
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4

loc_45C8B5:				; CODE XREF: sub_45C850+52j
cmp	dword ptr [esi+78h], 3
jz	short loc_45C8CC
mov	[esi+64h], ebp
mov	[esi+68h], edi
mov	[esi+6Ch], edi
mov	[esi+88h], edi
jmp	short loc_45C8E6
; ---------------------------------------------------------------------------

loc_45C8CC:				; CODE XREF: sub_45C850+69j
cmp	[esi+88h], edi
jz	short loc_45C8D9
mov	[esi+68h], ebp
jmp	short loc_45C8E6
; ---------------------------------------------------------------------------

loc_45C8D9:				; CODE XREF: sub_45C850+82j
cmp	[esi+5Ch], edi
jz	short loc_45C8E3
mov	[esi+6Ch], ebp
jmp	short loc_45C8E6
; ---------------------------------------------------------------------------

loc_45C8E3:				; CODE XREF: sub_45C850+8Cj
mov	[esi+64h], ebp

loc_45C8E6:				; CODE XREF: sub_45C850+7Aj
					; sub_45C850+87j ...
cmp	[esi+64h], edi
jz	short loc_45C8FD
push	esi
call	sub_467830
mov	edx, [esi+1CCh]
add	esp, 4
mov	[ebx+14h], edx

loc_45C8FD:				; CODE XREF: sub_45C850+99j
cmp	[esi+6Ch], edi
jnz	short loc_45C907
cmp	[esi+68h], edi
jz	short loc_45C919

loc_45C907:				; CODE XREF: sub_45C850+B0j
push	esi
call	sub_4663F0
mov	eax, [esi+1CCh]
add	esp, 4
mov	[ebx+18h], eax

loc_45C919:				; CODE XREF: sub_45C850+4Dj
					; sub_45C850+B5j
cmp	[esi+44h], edi
jnz	short loc_45C94B
mov	eax, [ebx+10h]
push	esi
cmp	eax, edi
jz	short loc_45C930
call	sub_465E00
add	esp, 4
jmp	short loc_45C93E
; ---------------------------------------------------------------------------

loc_45C930:				; CODE XREF: sub_45C850+D4j
call	sub_465790
push	esi
call	sub_465010
add	esp, 8

loc_45C93E:				; CODE XREF: sub_45C850+DEj
mov	ecx, [esi+6Ch]
push	ecx
push	esi
call	sub_464CA0
add	esp, 8

loc_45C94B:				; CODE XREF: sub_45C850+CCj
push	esi
call	sub_4649E0
mov	eax, [esi+0E0h]
add	esp, 4
cmp	eax, edi
jz	short loc_45C96A
mov	edx, [esi]
push	esi
mov	[edx+14h], ebp
mov	eax, [esi]
call	dword ptr [eax]
jmp	short loc_45C981
; ---------------------------------------------------------------------------

loc_45C96A:				; CODE XREF: sub_45C850+10Cj
mov	eax, [esi+0DCh]
push	esi
cmp	eax, edi
jz	short loc_45C97C
call	sub_463C60
jmp	short loc_45C981
; ---------------------------------------------------------------------------

loc_45C97C:				; CODE XREF: sub_45C850+123j
call	sub_463600

loc_45C981:				; CODE XREF: sub_45C850+118j
					; sub_45C850+12Aj
mov	ecx, [esi+1B4h]
add	esp, 4
cmp	[ecx+10h], edi
jnz	short loc_45C998
cmp	[esi+40h], edi
jnz	short loc_45C998
xor	eax, eax
jmp	short loc_45C99A
; ---------------------------------------------------------------------------

loc_45C998:				; CODE XREF: sub_45C850+13Dj
					; sub_45C850+142j
mov	eax, ebp

loc_45C99A:				; CODE XREF: sub_45C850+146j
push	eax
push	esi
call	sub_462160
mov	eax, [esi+44h]
add	esp, 8
cmp	eax, edi
jnz	short loc_45C9B5
push	edi
push	esi
call	sub_461A60
add	esp, 8

loc_45C9B5:				; CODE XREF: sub_45C850+159j
mov	edx, [esi+4]
push	esi
call	dword ptr [edx+18h]
mov	eax, [esi+1B4h]
push	esi
call	dword ptr [eax+8]
mov	ecx, [esi+8]
add	esp, 8
cmp	ecx, edi
jz	short loc_45CA23
cmp	[esi+40h], edi
jnz	short loc_45CA23
mov	edx, [esi+1B4h]
cmp	[edx+10h], edi
jz	short loc_45CA23
mov	eax, [esi+0DCh]
cmp	eax, edi
mov	eax, [esi+24h]
jz	short loc_45C9F1
lea	eax, [eax+eax*2+2]

loc_45C9F1:				; CODE XREF: sub_45C850+19Bj
mov	[ecx+4], edi
mov	ecx, [esi+140h]
imul	ecx, eax
mov	edx, [esi+8]
mov	[edx+8], ecx
mov	eax, [esi+8]
xor	ecx, ecx
mov	[eax+0Ch], edi
mov	ebp, [esi+6Ch]
mov	edx, [esi+8]
cmp	ebp, edi
setnz	cl
add	ecx, 2
mov	[edx+10h], ecx
mov	eax, [ebx+0Ch]
inc	eax
mov	[ebx+0Ch], eax

loc_45CA23:				; CODE XREF: sub_45C850+17Ej
					; sub_45C850+183j ...
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
sub_45C850 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45CA30 proc	near			; CODE XREF: sub_45C850+15p

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	edi
push	580h
mov	eax, [esi+4]
push	1
push	esi
call	dword ptr [eax]
mov	edx, eax
add	esp, 0Ch
add	edx, 100h
mov	ecx, 40h
xor	eax, eax
mov	[esi+144h], edx
lea	edi, [edx-100h]
rep stosd

loc_45CA63:				; CODE XREF: sub_45CA30+3Cj
mov	[eax+edx], al
inc	eax
cmp	eax, 0FFh
jle	short loc_45CA63
add	edx, 80h
mov	ecx, 60h
or	eax, 0FFFFFFFFh
lea	edi, [edx+80h]
rep stosd
mov	ecx, 60h
xor	eax, eax
lea	edi, [edx+200h]
rep stosd
mov	esi, [esi+144h]
lea	edi, [edx+380h]
mov	ecx, 20h
rep movsd
pop	edi
pop	esi
retn
sub_45CA30 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45CAB0 proc	near			; DATA XREF: sub_45C810+16o

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	edi
mov	edi, [esi+1A4h]
mov	eax, [edi+8]
test	eax, eax
jz	short loc_45CAF3
mov	dword ptr [edi+8], 0
mov	eax, [esi+1CCh]
push	0
push	esi
call	dword ptr [eax]
mov	ecx, [esi+1B0h]
push	2
push	esi
call	dword ptr [ecx]
mov	edx, [esi+1A8h]
push	2
push	esi
call	dword ptr [edx]
add	esp, 18h
jmp	loc_45CBBC
; ---------------------------------------------------------------------------

loc_45CAF3:				; CODE XREF: sub_45CAB0+11j
mov	eax, [esi+54h]
test	eax, eax
jz	short loc_45CB47
mov	eax, [esi+88h]
test	eax, eax
jnz	short loc_45CB47
mov	eax, [esi+5Ch]
test	eax, eax
jz	short loc_45CB24
mov	eax, [esi+6Ch]
test	eax, eax
jz	short loc_45CB24
mov	eax, [edi+18h]
mov	[esi+1CCh], eax
mov	dword ptr [edi+8], 1
jmp	short loc_45CB47
; ---------------------------------------------------------------------------

loc_45CB24:				; CODE XREF: sub_45CAB0+59j
					; sub_45CAB0+60j
mov	eax, [esi+64h]
test	eax, eax
jz	short loc_45CB36
mov	ecx, [edi+14h]
mov	[esi+1CCh], ecx
jmp	short loc_45CB47
; ---------------------------------------------------------------------------

loc_45CB36:				; CODE XREF: sub_45CAB0+79j
mov	edx, [esi]
push	esi
mov	dword ptr [edx+14h], 2Eh
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4

loc_45CB47:				; CODE XREF: sub_45CAB0+48j
					; sub_45CAB0+52j ...
mov	ecx, [esi+1C0h]
push	esi
call	dword ptr [ecx]
mov	edx, [esi+1ACh]
push	esi
call	dword ptr [edx+8]
mov	eax, [esi+44h]
add	esp, 8
test	eax, eax
jnz	short loc_45CBBC
mov	eax, [edi+10h]
test	eax, eax
jnz	short loc_45CB77
mov	eax, [esi+1C8h]
push	esi
call	dword ptr [eax]
add	esp, 4

loc_45CB77:				; CODE XREF: sub_45CAB0+B9j
mov	ecx, [esi+1C4h]
push	esi
call	dword ptr [ecx]
mov	eax, [esi+54h]
add	esp, 4
test	eax, eax
jz	short loc_45CB9A
mov	eax, [edi+8]
mov	edx, [esi+1CCh]
push	eax
push	esi
call	dword ptr [edx]
add	esp, 8

loc_45CB9A:				; CODE XREF: sub_45CAB0+D8j
mov	edx, [edi+8]
mov	ecx, [esi+1B0h]
neg	edx
sbb	edx, edx
and	edx, 3
push	edx
push	esi
call	dword ptr [ecx]
mov	eax, [esi+1A8h]
push	0
push	esi
call	dword ptr [eax]
add	esp, 10h

loc_45CBBC:				; CODE XREF: sub_45CAB0+3Ej
					; sub_45CAB0+B2j
mov	eax, [esi+8]
test	eax, eax
jz	short loc_45CC09
mov	ecx, [edi+0Ch]
xor	edx, edx
mov	[eax+0Ch], ecx
mov	ecx, [edi+8]
mov	eax, [esi+8]
test	ecx, ecx
mov	ecx, [edi+0Ch]
setnz	dl
inc	edx
add	edx, ecx
mov	[eax+10h], edx
mov	eax, [esi+40h]
test	eax, eax
jz	short loc_45CC09
mov	ecx, [esi+1B4h]
mov	eax, [ecx+14h]
test	eax, eax
jnz	short loc_45CC09
mov	edi, [esi+6Ch]
mov	eax, [esi+8]
xor	edx, edx
mov	ecx, [eax+10h]
test	edi, edi
setnz	dl
inc	edx
add	ecx, edx
mov	[eax+10h], ecx

loc_45CC09:				; CODE XREF: sub_45CAB0+111j
					; sub_45CAB0+134j ...
pop	edi
pop	esi
retn
sub_45CAB0 endp

; ---------------------------------------------------------------------------
align 10h

loc_45CC10:				; DATA XREF: sub_45C810+1Co
mov	eax, [esp+4]
push	esi
mov	ecx, [eax+54h]
mov	esi, [eax+1A4h]
test	ecx, ecx
jz	short loc_45CC2F
mov	ecx, [eax+1CCh]
push	eax
call	dword ptr [ecx+8]
add	esp, 4

loc_45CC2F:				; CODE XREF: .text:0045CC20j
mov	eax, [esi+0Ch]
inc	eax
mov	[esi+0Ch], eax
pop	esi
retn
; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_45CC40(int, size_t)
sub_45CC40 proc	near			; CODE XREF: sub_4589C0+1Ap
					; sub_458B00+ABp ...

arg_4= dword ptr  8

mov	eax, [esp+arg_4]
push	eax				; size_t
call	_malloc
add	esp, 4
retn
sub_45CC40 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_45CC50(int, void *)
sub_45CC50 proc	near			; CODE XREF: sub_4594B0+D6p
					; sub_4595B0+1Fp

arg_4= dword ptr  8

mov	eax, [esp+arg_4]
push	eax				; void *
call	_free
pop	ecx
retn
sub_45CC50 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_45CC60(int, size_t)
sub_45CC60 proc	near			; CODE XREF: sub_458C50+5Dp

arg_4= dword ptr  8

mov	eax, [esp+arg_4]
push	eax				; size_t
call	_malloc
add	esp, 4
retn
sub_45CC60 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_45CC70(int, void *)
sub_45CC70 proc	near			; CODE XREF: sub_4594B0+9Fp

arg_4= dword ptr  8

mov	eax, [esp+arg_4]
push	eax				; void *
call	_free
pop	ecx
retn
sub_45CC70 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45CC80 proc	near			; CODE XREF: sub_458F40+70p

arg_8= dword ptr  0Ch

mov	eax, [esp+arg_8]
retn
sub_45CC80 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45CC90 proc	near			; CODE XREF: sub_458F40+C9p
					; sub_458F40+140p

arg_0= dword ptr  4

mov	eax, [esp+arg_0]
push	eax
mov	ecx, [eax]
mov	dword ptr [ecx+14h], 31h
mov	edx, [eax]
call	dword ptr [edx]
pop	ecx
retn
sub_45CC90 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45CCB0 proc	near			; CODE XREF: sub_4589C0+Ep
xor	eax, eax
retn
sub_45CCB0 endp

; ---------------------------------------------------------------------------
align 10h
; [00000001 BYTES: COLLAPSED FUNCTION nullsub_5. PRESS KEYPAD CTRL-"+" TO EXPAND]
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45CCD0 proc	near			; CODE XREF: sub_45A0D0+A7p
					; sub_45A0D0+C0p ...

arg_0= dword ptr  4
arg_4= dword ptr  8

mov	ecx, [esp+arg_4]
mov	eax, [esp+arg_0]
lea	eax, [eax+ecx-1]
cdq
idiv	ecx
retn
sub_45CCD0 endp


; =============== S U B	R O U T	I N E =======================================


sub_45CCE0 proc	near			; CODE XREF: sub_45CF30+4Cp
					; sub_45CF30+5Dp ...

arg_0= dword ptr  4
arg_4= dword ptr  8

mov	eax, [esp+arg_0]
push	esi
mov	esi, [esp+4+arg_4]
lea	ecx, [eax+esi-1]
mov	eax, ecx
cdq
idiv	esi
mov	eax, ecx
pop	esi
sub	eax, edx
retn
sub_45CCE0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45CD00 proc	near			; CODE XREF: sub_45F9F0+22p
					; sub_45FA30+B5p ...

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h
arg_14=	dword ptr  18h

mov	eax, [esp+arg_4]
mov	ecx, [esp+arg_0]
mov	edx, [esp+arg_C]
push	ebx
mov	ebx, [esp+4+arg_10]
lea	eax, [ecx+eax*4]
mov	ecx, [esp+4+arg_8]
test	ebx, ebx
lea	edx, [ecx+edx*4]
jle	short loc_45CD44
push	ebp
push	esi
push	edi

loc_45CD22:				; CODE XREF: sub_45CD00+3Fj
mov	ecx, [esp+10h+arg_14]
mov	esi, [eax]
mov	edi, [edx]
mov	ebp, ecx
shr	ecx, 2
rep movsd
mov	ecx, ebp
add	eax, 4
add	edx, 4
and	ecx, 3
dec	ebx
rep movsb
jnz	short loc_45CD22
pop	edi
pop	esi
pop	ebp

loc_45CD44:				; CODE XREF: sub_45CD00+1Dj
pop	ebx
retn
sub_45CD00 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45CD50 proc	near			; CODE XREF: sub_462A90+299p

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

mov	ecx, [esp+arg_8]
push	esi
mov	esi, [esp+4+arg_0]
push	edi
mov	edi, [esp+8+arg_4]
shl	ecx, 7
mov	eax, ecx
shr	ecx, 2
rep movsd
mov	ecx, eax
and	ecx, 3
rep movsb
pop	edi
pop	esi
retn
sub_45CD50 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45CD80 proc	near			; CODE XREF: sub_4590D0+F6p
					; sub_4592C0+F3p ...

arg_0= dword ptr  4
arg_4= dword ptr  8

mov	ecx, [esp+arg_4]
push	edi
mov	edi, [esp+4+arg_0]
mov	edx, ecx
xor	eax, eax
shr	ecx, 2
rep stosd
mov	ecx, edx
and	ecx, 3
rep stosb
pop	edi
retn
sub_45CD80 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45CDA0 proc	near			; CODE XREF: sub_459F80+96p

arg_0= dword ptr  4
arg_4= dword ptr  8

push	ebp
push	esi
mov	esi, [esp+8+arg_0]
push	40h
push	1
push	esi
mov	eax, [esi+4]
call	dword ptr [eax]
mov	[esi+150h], eax
mov	dword ptr [eax], offset	loc_45CE30
mov	ecx, [esi+0B0h]
add	esp, 0Ch
test	ecx, ecx
jnz	short loc_45CE24
mov	ecx, [esp+8+arg_4]
test	ecx, ecx
jz	short loc_45CDE5
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 4
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4
pop	esi
pop	ebp
retn
; ---------------------------------------------------------------------------

loc_45CDE5:				; CODE XREF: sub_45CDA0+2Fj
mov	edx, [esi+3Ch]
mov	ecx, [esi+44h]
xor	ebp, ebp
test	edx, edx
jle	short loc_45CE24
push	ebx
push	edi
lea	edi, [ecx+1Ch]
lea	ebx, [eax+18h]

loc_45CDF9:				; CODE XREF: sub_45CDA0+80j
mov	ecx, [edi-10h]
mov	edx, [edi]
mov	eax, [esi+4]
shl	ecx, 3
shl	edx, 3
push	ecx
push	edx
push	1
push	esi
call	dword ptr [eax+8]
add	esp, 10h
mov	[ebx], eax
mov	eax, [esi+3Ch]
inc	ebp
add	ebx, 4
add	edi, 54h
cmp	ebp, eax
jl	short loc_45CDF9
pop	edi
pop	ebx

loc_45CE24:				; CODE XREF: sub_45CDA0+27j
					; sub_45CDA0+4Fj
pop	esi
pop	ebp
retn
sub_45CDA0 endp

; ---------------------------------------------------------------------------
align 10h

loc_45CE30:				; DATA XREF: sub_45CDA0+16o
mov	ecx, [esp+4]
mov	edx, [ecx+0B0h]
mov	eax, [ecx+150h]
test	edx, edx
jnz	short locret_45CE7D
mov	edx, [esp+8]
mov	dword ptr [eax+8], 0
test	edx, edx
mov	dword ptr [eax+0Ch], 0
mov	dword ptr [eax+10h], 0
mov	[eax+14h], edx
jz	short loc_45CE76
mov	eax, [ecx]
push	ecx
mov	dword ptr [eax+14h], 4
mov	edx, [ecx]
call	dword ptr [edx]
add	esp, 4
retn
; ---------------------------------------------------------------------------

loc_45CE76:				; CODE XREF: .text:0045CE62j
mov	dword ptr [eax+4], offset sub_45CE80

locret_45CE7D:				; CODE XREF: .text:0045CE42j
retn
; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45CE80 proc	near			; DATA XREF: .text:loc_45CE76o

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

push	ebx
push	ebp
push	esi
push	edi
mov	edi, [esp+10h+arg_0]
mov	esi, [edi+150h]
mov	ecx, [edi+0F0h]
mov	eax, [esi+8]
cmp	eax, ecx
jnb	loc_45CF2B
mov	ebp, [esp+10h+arg_8]
lea	ebx, [esi+0Ch]

loc_45CEA6:				; CODE XREF: sub_45CE80+92j
cmp	dword ptr [ebx], 8
jnb	short loc_45CECF
mov	eax, [esp+10h+arg_C]
mov	ecx, [edi+154h]
push	8
lea	edx, [esi+18h]
push	ebx
push	edx
mov	edx, [esp+1Ch+arg_4]
push	eax
push	ebp
push	edx
push	edi
call	dword ptr [ecx+4]
mov	eax, [ebx]
add	esp, 1Ch
cmp	eax, 8

loc_45CECF:				; CODE XREF: sub_45CE80+29j
jnz	short loc_45CF2B
mov	eax, [edi+158h]
lea	ecx, [esi+18h]
push	ecx
push	edi
call	dword ptr [eax+4]
add	esp, 8
test	eax, eax
mov	eax, [esi+10h]
jz	short loc_45CF19
test	eax, eax
jz	short loc_45CEFB
mov	eax, [ebp+0]
inc	eax
mov	[ebp+0], eax
mov	dword ptr [esi+10h], 0

loc_45CEFB:				; CODE XREF: sub_45CE80+6Bj
mov	edx, [esi+8]
mov	dword ptr [ebx], 0
inc	edx
mov	[esi+8], edx
mov	ecx, [edi+0F0h]
mov	eax, edx
cmp	eax, ecx
jb	short loc_45CEA6
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_45CF19:				; CODE XREF: sub_45CE80+67j
test	eax, eax
jnz	short loc_45CF2B
mov	eax, [ebp+0]
dec	eax
mov	[ebp+0], eax
mov	dword ptr [esi+10h], 1

loc_45CF2B:				; CODE XREF: sub_45CE80+19j
					; sub_45CE80:loc_45CECFj ...
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
sub_45CE80 endp


; =============== S U B	R O U T	I N E =======================================


sub_45CF30 proc	near			; CODE XREF: sub_459F80+8Ep

arg_0= dword ptr  4
arg_4= dword ptr  8

push	ebx
push	esi
push	edi
mov	edi, [esp+0Ch+arg_0]
push	68h
push	1
mov	eax, [edi+4]
push	edi
call	dword ptr [eax]
mov	ebx, eax
mov	eax, [esp+18h+arg_4]
xor	esi, esi
add	esp, 0Ch
mov	[edi+158h], ebx
cmp	eax, esi
mov	dword ptr [ebx], offset	sub_45CFF0
jz	short loc_45CFBE
mov	ecx, [edi+3Ch]
mov	eax, [edi+44h]
cmp	ecx, esi
mov	[esp+0Ch+arg_0], esi
jle	short loc_45CFE7
push	ebp
lea	esi, [eax+0Ch]
add	ebx, 40h

loc_45CF71:				; CODE XREF: sub_45CF30+87j
mov	eax, [esi]
mov	ecx, [esi+14h]
mov	ebp, [edi+4]
push	eax
push	eax
push	ecx
call	sub_45CCE0
mov	edx, [esi-4]
add	esp, 8
push	eax
mov	eax, [esi+10h]
push	edx
push	eax
call	sub_45CCE0
add	esp, 8
push	eax
push	0
push	1
push	edi
call	dword ptr [ebp+14h]
mov	[ebx], eax
mov	eax, [esp+28h+arg_0]
mov	ecx, [edi+3Ch]
add	esp, 18h
inc	eax
add	ebx, 4
add	esi, 54h
cmp	eax, ecx
mov	[esp+10h+arg_0], eax
jl	short loc_45CF71
pop	ebp
pop	edi
pop	esi
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_45CFBE:				; CODE XREF: sub_45CF30+2Aj
mov	ecx, [edi+4]
push	500h
push	1
push	edi
call	dword ptr [ecx+4]
add	esp, 0Ch
lea	ecx, [ebx+18h]
mov	edx, 0Ah

loc_45CFD7:				; CODE XREF: sub_45CF30+B2j
mov	[ecx], eax
add	ecx, 4
add	eax, 80h
dec	edx
jnz	short loc_45CFD7
mov	[ebx+40h], esi

loc_45CFE7:				; CODE XREF: sub_45CF30+38j
pop	edi
pop	esi
pop	ebx
retn
sub_45CF30 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45CFF0 proc	near			; DATA XREF: sub_45CF30+24o

arg_0= dword ptr  4
arg_4= dword ptr  8

push	esi
mov	esi, [esp+4+arg_0]
push	edi
push	esi
mov	edi, [esi+158h]
mov	dword ptr [edi+8], 0
call	sub_45D0A0
mov	eax, [esp+0Ch+arg_4]
add	esp, 4
sub	eax, 0
jz	short loc_45D075
sub	eax, 2
jz	short loc_45D053
dec	eax
jz	short loc_45D031
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 4
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45D031:				; CODE XREF: sub_45CFF0+2Bj
mov	eax, [edi+40h]
test	eax, eax
jnz	short loc_45D049
mov	edx, [esi]
push	esi
mov	dword ptr [edx+14h], 4
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4

loc_45D049:				; CODE XREF: sub_45CFF0+46j
mov	dword ptr [edi+4], offset sub_45D350
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45D053:				; CODE XREF: sub_45CFF0+28j
mov	eax, [edi+40h]
test	eax, eax
jnz	short loc_45D06B
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 4
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4

loc_45D06B:				; CODE XREF: sub_45CFF0+68j
mov	dword ptr [edi+4], offset sub_45D5A0
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45D075:				; CODE XREF: sub_45CFF0+23j
mov	eax, [edi+40h]
test	eax, eax
jz	short loc_45D08D
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 4
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4

loc_45D08D:				; CODE XREF: sub_45CFF0+8Aj
mov	dword ptr [edi+4], offset sub_45D0F0
pop	edi
pop	esi
retn
sub_45CFF0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45D0A0 proc	near			; CODE XREF: sub_45CFF0+14p
					; sub_45D0F0+235p ...

arg_0= dword ptr  4

mov	ecx, [esp+arg_0]
push	esi
mov	edx, 1
mov	esi, [ecx+0F4h]
mov	eax, [ecx+158h]
cmp	esi, edx
jg	short loc_45D0E1
mov	edx, [ecx+0F0h]
mov	esi, [eax+8]
mov	ecx, [ecx+0F8h]
dec	edx
cmp	esi, edx
jnb	short loc_45D0DE
mov	edx, [ecx+0Ch]
xor	ecx, ecx
mov	[eax+14h], edx
mov	[eax+0Ch], ecx
mov	[eax+10h], ecx
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45D0DE:				; CODE XREF: sub_45D0A0+2Cj
mov	edx, [ecx+48h]

loc_45D0E1:				; CODE XREF: sub_45D0A0+18j
xor	ecx, ecx
mov	[eax+14h], edx
mov	[eax+0Ch], ecx
mov	[eax+10h], ecx
pop	esi
retn
sub_45D0A0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45D0F0 proc	near			; DATA XREF: sub_45CFF0:loc_45D08Do

var_28=	dword ptr -28h
var_24=	dword ptr -24h
var_20=	dword ptr -20h
var_1C=	dword ptr -1Ch
var_18=	dword ptr -18h
var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8

sub	esp, 28h
push	ebx
push	ebp
push	esi
mov	esi, [esp+34h+arg_0]
push	edi
mov	ecx, [esi+108h]
mov	eax, [esi+0F0h]
mov	ebp, [esi+158h]
dec	ecx
dec	eax
mov	[esp+38h+var_14], ecx
mov	edx, [ebp+14h]
mov	[esp+38h+var_4], eax
mov	eax, [ebp+10h]
cmp	eax, edx
mov	[esp+38h+var_28], eax
jge	loc_45D31D
jmp	short loc_45D12F
; ---------------------------------------------------------------------------

loc_45D12B:				; CODE XREF: sub_45D0F0+227j
mov	ecx, [esp+38h+var_14]

loc_45D12F:				; CODE XREF: sub_45D0F0+39j
mov	ebx, [ebp+0Ch]
cmp	ebx, ecx
mov	[esp+38h+var_24], ebx
ja	loc_45D306

loc_45D13E:				; CODE XREF: sub_45D0F0+20Cj
mov	eax, [esi+0F4h]
xor	edi, edi
cmp	eax, edi
mov	[esp+38h+var_10], edi
jle	loc_45D2DC
add	esi, 0F8h
mov	[esp+38h+var_C], esi

loc_45D15C:				; CODE XREF: sub_45D0F0+1E4j
mov	eax, [esp+38h+var_14]
mov	esi, [esi]
cmp	ebx, eax
jnb	short loc_45D16B
mov	ebx, [esi+34h]
jmp	short loc_45D16E
; ---------------------------------------------------------------------------

loc_45D16B:				; CODE XREF: sub_45D0F0+74j
mov	ebx, [esi+44h]

loc_45D16E:				; CODE XREF: sub_45D0F0+79j
mov	eax, [esi+40h]
mov	ecx, [esp+38h+var_28]
imul	eax, [esp+38h+var_24]
shl	ecx, 3
mov	[esp+38h+var_1C], ecx
mov	ecx, [esi+38h]
test	ecx, ecx
mov	[esp+38h+var_8], eax
mov	[esp+38h+var_18], 0
jle	loc_45D2B0
jmp	short loc_45D19E
; ---------------------------------------------------------------------------

loc_45D19A:				; CODE XREF: sub_45D0F0+1BAj
mov	eax, [esp+38h+var_8]

loc_45D19E:				; CODE XREF: sub_45D0F0+A8j
mov	edx, [esp+38h+var_4]
mov	ecx, [ebp+8]
cmp	ecx, edx
jb	short loc_45D20B
mov	ecx, [esp+38h+var_28]
mov	edx, [esp+38h+var_18]
add	edx, ecx
mov	ecx, [esi+48h]
cmp	edx, ecx
jl	short loc_45D20B
mov	eax, [esi+34h]
mov	ecx, [ebp+edi*4+18h]
shl	eax, 7
push	eax
push	ecx
call	sub_45CD80
mov	ecx, [esi+34h]
add	esp, 8
xor	eax, eax
test	ecx, ecx
jle	loc_45D28C
lea	ecx, [ebp+edi*4+18h]
mov	[esp+38h+var_20], ecx

loc_45D1E3:				; CODE XREF: sub_45D0F0+114j
mov	ecx, [esp+38h+var_20]
mov	edx, [ebp+edi*4+14h]
inc	eax
mov	ecx, [ecx]
mov	dx, [edx]
mov	[ecx], dx
mov	edx, [esp+38h+var_20]
mov	ecx, [esi+34h]
add	edx, 4
cmp	eax, ecx
mov	[esp+38h+var_20], edx
jl	short loc_45D1E3
jmp	loc_45D28C
; ---------------------------------------------------------------------------

loc_45D20B:				; CODE XREF: sub_45D0F0+B7j
					; sub_45D0F0+C8j
mov	ecx, [esp+38h+arg_0]
push	ebx
push	eax
mov	eax, [esp+40h+var_1C]
mov	edx, [ecx+168h]
mov	ecx, [ebp+edi*4+18h]
push	eax
mov	eax, [esi+4]
push	ecx
mov	ecx, [esp+48h+arg_4]
mov	eax, [ecx+eax*4]
mov	ecx, [esp+48h+arg_0]
push	eax
push	esi
push	ecx
call	dword ptr [edx+4]
mov	eax, [esi+34h]
add	esp, 1Ch
cmp	ebx, eax
jge	short loc_45D28C
mov	edx, ebx
shl	edx, 19h
sub	edx, ebx
add	edx, eax
lea	eax, [ebx+edi]
shl	edx, 7
mov	ecx, [ebp+eax*4+18h]
push	edx
push	ecx
call	sub_45CD80
mov	eax, [esi+34h]
add	esp, 8
cmp	ebx, eax
mov	[esp+38h+var_20], ebx
jge	short loc_45D28C
lea	edx, [ebx+edi]
lea	eax, [ebp+edx*4+18h]

loc_45D26E:				; CODE XREF: sub_45D0F0+19Aj
mov	ecx, [eax-4]
mov	edx, [eax]
add	eax, 4
mov	cx, [ecx]
mov	[edx], cx
mov	ecx, [esp+38h+var_20]
mov	edx, [esi+34h]
inc	ecx
cmp	ecx, edx
mov	[esp+38h+var_20], ecx
jl	short loc_45D26E

loc_45D28C:				; CODE XREF: sub_45D0F0+E5j
					; sub_45D0F0+116j ...
mov	eax, [esp+38h+var_1C]
mov	ecx, [esi+34h]
add	eax, 8
add	edi, ecx
mov	ecx, [esi+38h]
mov	[esp+38h+var_1C], eax
mov	eax, [esp+38h+var_18]
inc	eax
cmp	eax, ecx
mov	[esp+38h+var_18], eax
jl	loc_45D19A

loc_45D2B0:				; CODE XREF: sub_45D0F0+A2j
mov	edx, [esp+38h+arg_0]
mov	eax, [esp+38h+var_10]
mov	esi, [esp+38h+var_C]
mov	ebx, [esp+38h+var_24]
mov	ecx, [edx+0F4h]
inc	eax
add	esi, 4
cmp	eax, ecx
mov	[esp+38h+var_10], eax
mov	[esp+38h+var_C], esi
jl	loc_45D15C
mov	esi, edx

loc_45D2DC:				; CODE XREF: sub_45D0F0+5Cj
mov	eax, [esi+16Ch]
lea	ecx, [ebp+18h]
push	ecx
push	esi
call	dword ptr [eax+4]
add	esp, 8
test	eax, eax
jz	short loc_45D33A
mov	eax, [esp+38h+var_14]
inc	ebx
cmp	ebx, eax
mov	[esp+38h+var_24], ebx
jbe	loc_45D13E
mov	eax, [esp+38h+var_28]

loc_45D306:				; CODE XREF: sub_45D0F0+48j
mov	ecx, [ebp+14h]
inc	eax
cmp	eax, ecx
mov	dword ptr [ebp+0Ch], 0
mov	[esp+38h+var_28], eax
jl	loc_45D12B

loc_45D31D:				; CODE XREF: sub_45D0F0+33j
mov	edx, [ebp+8]
push	esi
inc	edx
mov	[ebp+8], edx
call	sub_45D0A0
add	esp, 4
mov	eax, 1
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 28h
retn
; ---------------------------------------------------------------------------

loc_45D33A:				; CODE XREF: sub_45D0F0+1FFj
mov	edx, [esp+38h+var_28]
pop	edi
mov	[ebp+10h], edx
mov	[ebp+0Ch], ebx
pop	esi
pop	ebp
xor	eax, eax
pop	ebx
add	esp, 28h
retn
sub_45D0F0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45D350 proc	near			; DATA XREF: sub_45CFF0:loc_45D049o

var_30=	dword ptr -30h
var_2C=	dword ptr -2Ch
var_28=	dword ptr -28h
var_24=	dword ptr -24h
var_20=	dword ptr -20h
var_1C=	dword ptr -1Ch
var_18=	dword ptr -18h
var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8

sub	esp, 30h
mov	ecx, [esp+30h+arg_0]
push	ebx
push	esi
push	edi
mov	ebx, [ecx+0F0h]
mov	eax, [ecx+3Ch]
mov	edi, [ecx+158h]
mov	esi, [ecx+44h]
dec	ebx
mov	[esp+3Ch+var_10], edi
test	eax, eax
mov	[esp+3Ch+var_14], ebx
mov	[esp+3Ch+var_8], 0
mov	[esp+3Ch+var_2C], esi
jle	loc_45D57F
mov	eax, [esp+3Ch+arg_4]
lea	edx, [edi+40h]
push	ebp
mov	[esp+40h+var_1C], eax
mov	[esp+40h+var_20], edx
jmp	short loc_45D3A7
; ---------------------------------------------------------------------------

loc_45D39B:				; CODE XREF: sub_45D350+228j
mov	edi, [esp+40h+var_10]
mov	ebx, [esp+40h+var_14]
mov	ecx, [esp+40h+arg_0]

loc_45D3A7:				; CODE XREF: sub_45D350+49j
mov	eax, [esi+0Ch]
push	1
push	eax
imul	eax, [edi+8]
mov	edx, [ecx+4]
push	eax
mov	eax, [esp+4Ch+var_20]
mov	eax, [eax]
push	eax
push	ecx
call	dword ptr [edx+20h]
mov	ecx, [esi+0Ch]
mov	[esp+54h+var_C], eax
mov	eax, [edi+8]
add	esp, 14h
cmp	eax, ebx
jnb	short loc_45D3D7
mov	[esp+40h+var_30], ecx
jmp	short loc_45D3EE
; ---------------------------------------------------------------------------

loc_45D3D7:				; CODE XREF: sub_45D350+7Fj
mov	eax, [esi+20h]
xor	edx, edx
div	ecx
test	edx, edx
mov	[esp+40h+var_30], edx
jnz	short loc_45D3EA
mov	[esp+40h+var_30], ecx

loc_45D3EA:				; CODE XREF: sub_45D350+94j
mov	ecx, [esp+40h+var_30]

loc_45D3EE:				; CODE XREF: sub_45D350+85j
mov	ebx, [esi+1Ch]
mov	ebp, [esi+8]
mov	eax, ebx
xor	edx, edx
div	ebp
mov	[esp+40h+var_24], ebp
mov	edi, edx
test	edi, edi
jle	short loc_45D40A
mov	edx, ebp
sub	edx, edi
mov	edi, edx

loc_45D40A:				; CODE XREF: sub_45D350+B2j
test	ecx, ecx
jle	loc_45D4A0
mov	ebp, [esp+40h+var_C]
mov	[esp+40h+var_28], 0
mov	[esp+40h+var_18], ecx

loc_45D422:				; CODE XREF: sub_45D350+142j
mov	edx, [esp+40h+var_28]
mov	esi, [ebp+0]
mov	eax, [esp+40h+arg_0]
push	ebx
push	0
push	edx
mov	edx, [esp+4Ch+var_1C]
mov	ecx, [eax+168h]
push	esi
mov	edx, [edx]
push	edx
mov	edx, [esp+54h+var_2C]
push	edx
push	eax
call	dword ptr [ecx+4]
add	esp, 1Ch
test	edi, edi
jle	short loc_45D47B
mov	eax, ebx
mov	ecx, edi
shl	eax, 7
shl	ecx, 7
add	esi, eax
push	ecx
push	esi
call	sub_45CD80
mov	cx, [esi-80h]
add	esp, 8
test	edi, edi
jle	short loc_45D47B
mov	eax, edi

loc_45D46F:				; CODE XREF: sub_45D350+129j
mov	[esi], cx
add	esi, 80h
dec	eax
jnz	short loc_45D46F

loc_45D47B:				; CODE XREF: sub_45D350+FDj
					; sub_45D350+11Bj
mov	ecx, [esp+40h+var_28]
mov	eax, [esp+40h+var_18]
add	ebp, 4
add	ecx, 8
dec	eax
mov	[esp+40h+var_28], ecx
mov	[esp+40h+var_18], eax
jnz	short loc_45D422
mov	ecx, [esp+40h+var_30]
mov	esi, [esp+40h+var_2C]
mov	ebp, [esp+40h+var_24]

loc_45D4A0:				; CODE XREF: sub_45D350+BCj
mov	eax, [esp+40h+var_10]
mov	edx, [esp+40h+var_14]
cmp	[eax+8], edx
jnz	loc_45D546
add	ebx, edi
xor	edx, edx
mov	eax, ebx
mov	[esp+40h+var_18], ecx
div	ebp
mov	[esp+40h+var_4], eax
mov	eax, [esi+0Ch]
cmp	ecx, eax
jge	short loc_45D546
mov	edx, [esp+40h+var_C]
shl	ebx, 7
lea	ecx, [edx+ecx*4]
mov	[esp+40h+var_30], ebx
mov	[esp+40h+var_28], ecx
jmp	short loc_45D4E0
; ---------------------------------------------------------------------------

loc_45D4DC:				; CODE XREF: sub_45D350+1F4j
mov	ecx, [esp+40h+var_28]

loc_45D4E0:				; CODE XREF: sub_45D350+18Aj
mov	eax, [esp+40h+var_30]
mov	edi, [ecx]
mov	ebx, [ecx-4]
push	eax
push	edi
call	sub_45CD80
mov	eax, [esp+48h+var_4]
add	esp, 8
test	eax, eax
jbe	short loc_45D52B
mov	ecx, ebp
mov	ebp, eax
shl	ecx, 7

loc_45D502:				; CODE XREF: sub_45D350+1D1j
mov	edx, [esp+40h+var_24]
mov	si, [ecx+ebx-80h]
test	edx, edx
jle	short loc_45D51C
mov	eax, edi

loc_45D511:				; CODE XREF: sub_45D350+1CAj
mov	[eax], si
add	eax, 80h
dec	edx
jnz	short loc_45D511

loc_45D51C:				; CODE XREF: sub_45D350+1BDj
add	edi, ecx
add	ebx, ecx
dec	ebp
jnz	short loc_45D502
mov	esi, [esp+40h+var_2C]
mov	ebp, [esp+40h+var_24]

loc_45D52B:				; CODE XREF: sub_45D350+1A9j
mov	eax, [esp+40h+var_18]
mov	edx, [esp+40h+var_28]
mov	ecx, [esi+0Ch]
inc	eax
add	edx, 4
cmp	eax, ecx
mov	[esp+40h+var_18], eax
mov	[esp+40h+var_28], edx
jl	short loc_45D4DC

loc_45D546:				; CODE XREF: sub_45D350+15Bj
					; sub_45D350+176j
mov	ebp, [esp+40h+var_20]
mov	ebx, [esp+40h+var_1C]
mov	eax, [esp+40h+var_8]
mov	ecx, 4
add	ebp, ecx
add	ebx, ecx
mov	ecx, [esp+40h+arg_0]
inc	eax
add	esi, 54h
mov	[esp+40h+var_8], eax
mov	edx, [ecx+3Ch]
mov	[esp+40h+var_20], ebp
cmp	eax, edx
mov	[esp+40h+var_1C], ebx
mov	[esp+40h+var_2C], esi
jl	loc_45D39B
pop	ebp

loc_45D57F:				; CODE XREF: sub_45D350+33j
mov	edx, [esp+3Ch+arg_4]
push	edx
push	ecx
call	sub_45D5A0
add	esp, 8
pop	edi
pop	esi
pop	ebx
add	esp, 30h
retn
sub_45D350 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45D5A0 proc	near			; CODE XREF: sub_45D350+235p
					; DATA XREF: sub_45CFF0:loc_45D06Bo

var_30=	dword ptr -30h
var_2C=	dword ptr -2Ch
var_28=	dword ptr -28h
var_24=	dword ptr -24h
var_20=	dword ptr -20h
var_1C=	dword ptr -1Ch
var_18=	dword ptr -18h
var_14=	dword ptr -14h
var_10=	byte ptr -10h
arg_0= dword ptr  4

sub	esp, 30h
push	ebx
push	ebp
push	esi
mov	esi, [esp+3Ch+arg_0]
push	edi
xor	ebx, ebx
mov	eax, [esi+0F4h]
mov	edi, [esi+158h]
test	eax, eax
mov	[esp+40h+var_1C], edi
jle	short loc_45D61B
lea	eax, [esp+40h+var_10]
lea	ecx, [esi+0F8h]
mov	[esp+40h+var_28], eax
mov	[esp+40h+var_30], ecx

loc_45D5D3:				; CODE XREF: sub_45D5A0+79j
mov	edx, [esp+40h+var_30]
mov	ebp, [edi+8]
push	0
mov	eax, [edx]
mov	edx, [esi+4]
mov	ecx, [eax+0Ch]
mov	eax, [eax+4]
imul	ebp, ecx
push	ecx
mov	ecx, [edi+eax*4+40h]
push	ebp
push	ecx
push	esi
call	dword ptr [edx+20h]
mov	ecx, [esp+54h+var_28]
mov	ebp, [esp+54h+var_30]
add	esp, 14h
inc	ebx
mov	[ecx], eax
mov	eax, [esi+0F4h]
add	ebp, 4
add	ecx, 4
cmp	ebx, eax
mov	[esp+40h+var_30], ebp
mov	[esp+40h+var_28], ecx
jl	short loc_45D5D3

loc_45D61B:				; CODE XREF: sub_45D5A0+1Fj
mov	eax, [edi+10h]
mov	ecx, [edi+14h]
cmp	eax, ecx
mov	[esp+40h+var_30], eax
jge	loc_45D755

loc_45D62D:				; CODE XREF: sub_45D5A0+1AFj
mov	ebp, [edi+0Ch]
mov	ecx, [esi+108h]
cmp	ebp, ecx
mov	[esp+40h+var_18], ebp
jnb	loc_45D73E

loc_45D642:				; CODE XREF: sub_45D5A0+194j
mov	eax, [esi+0F4h]
xor	ebx, ebx
cmp	eax, ebx
mov	[esp+40h+var_20], ebx
jle	loc_45D712
lea	edx, [esp+40h+var_10]
lea	eax, [esi+0F8h]
mov	[esp+40h+var_28], edx
mov	[esp+40h+var_2C], eax

loc_45D668:				; CODE XREF: sub_45D5A0+168j
mov	ecx, [esp+40h+var_2C]
mov	[esp+40h+var_24], 0
mov	edi, [ecx]
mov	ecx, [edi+34h]
mov	edx, [edi+38h]
mov	eax, ecx
imul	eax, ebp
test	edx, edx
jle	short loc_45D6DE
mov	edx, [esp+40h+var_28]
shl	eax, 7
mov	[esp+40h+var_14], eax
mov	eax, [edx]
mov	edx, [esp+40h+var_30]
lea	ebp, [eax+edx*4]

loc_45D699:				; CODE XREF: sub_45D5A0+138j
mov	eax, [ebp+0]
mov	edx, [esp+40h+var_14]
add	eax, edx
xor	edx, edx
test	ecx, ecx
jle	short loc_45D6C7
mov	ecx, [esp+40h+var_1C]
lea	esi, [ecx+ebx*4+18h]

loc_45D6B0:				; CODE XREF: sub_45D5A0+121j
mov	[esi], eax
mov	ecx, [edi+34h]
inc	ebx
add	esi, 4
add	eax, 80h
inc	edx
cmp	edx, ecx
jl	short loc_45D6B0
mov	esi, [esp+40h+arg_0]

loc_45D6C7:				; CODE XREF: sub_45D5A0+106j
mov	eax, [esp+40h+var_24]
mov	edx, [edi+38h]
inc	eax
add	ebp, 4
cmp	eax, edx
mov	[esp+40h+var_24], eax
jl	short loc_45D699
mov	ebp, [esp+40h+var_18]

loc_45D6DE:				; CODE XREF: sub_45D5A0+E3j
mov	edi, [esp+40h+var_2C]
mov	edx, [esp+40h+var_28]
mov	eax, [esp+40h+var_20]
mov	ecx, 4
add	edi, ecx
add	edx, ecx
mov	ecx, [esi+0F4h]
inc	eax
cmp	eax, ecx
mov	[esp+40h+var_20], eax
mov	[esp+40h+var_2C], edi
mov	[esp+40h+var_28], edx
jl	loc_45D668
mov	edi, [esp+40h+var_1C]

loc_45D712:				; CODE XREF: sub_45D5A0+B0j
mov	edx, [esi+16Ch]
lea	eax, [edi+18h]
push	eax
push	esi
call	dword ptr [edx+4]
add	esp, 8
test	eax, eax
jz	short loc_45D772
mov	eax, [esi+108h]
inc	ebp
cmp	ebp, eax
mov	[esp+40h+var_18], ebp
jb	loc_45D642
mov	eax, [esp+40h+var_30]

loc_45D73E:				; CODE XREF: sub_45D5A0+9Cj
mov	ecx, [edi+14h]
inc	eax
cmp	eax, ecx
mov	dword ptr [edi+0Ch], 0
mov	[esp+40h+var_30], eax
jl	loc_45D62D

loc_45D755:				; CODE XREF: sub_45D5A0+87j
mov	edx, [edi+8]
push	esi
inc	edx
mov	[edi+8], edx
call	sub_45D0A0
add	esp, 4
mov	eax, 1
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 30h
retn
; ---------------------------------------------------------------------------

loc_45D772:				; CODE XREF: sub_45D5A0+185j
mov	ecx, [esp+40h+var_30]
mov	[edi+0Ch], ebp
mov	[edi+10h], ecx
pop	edi
pop	esi
pop	ebp
xor	eax, eax
pop	ebx
add	esp, 30h
retn
sub_45D5A0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45D790 proc	near			; CODE XREF: sub_45DC20+10Dp
					; sub_45DC20+11Bp ...

var_518= dword ptr -518h
var_514= dword ptr -514h
var_510= dword ptr -510h
var_50C= dword ptr -50Ch
var_508= byte ptr -508h
var_507= byte ptr -507h
var_404= byte ptr -404h
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

sub	esp, 518h
push	ebx
push	ebp
push	esi
mov	esi, [esp+524h+arg_8]
push	edi
mov	edi, 32h
test	esi, esi
jl	short loc_45D7AF
cmp	esi, 4
jl	short loc_45D7CD

loc_45D7AF:				; CODE XREF: sub_45D790+18j
mov	ebp, [esp+528h+arg_0]
push	ebp
mov	eax, [ebp+0]
mov	[eax+14h], edi
mov	ecx, [ebp+0]
mov	[ecx+18h], esi
mov	edx, [ebp+0]
call	dword ptr [edx]
add	esp, 4
jmp	short loc_45D7D4
; ---------------------------------------------------------------------------

loc_45D7CD:				; CODE XREF: sub_45D790+1Dj
mov	ebp, [esp+528h+arg_0]

loc_45D7D4:				; CODE XREF: sub_45D790+3Bj
mov	eax, [esp+528h+arg_4]
test	eax, eax
jz	short loc_45D7E9
mov	eax, [ebp+esi*4+58h]
mov	[esp+528h+var_514], eax
jmp	short loc_45D7F1
; ---------------------------------------------------------------------------

loc_45D7E9:				; CODE XREF: sub_45D790+4Dj
mov	ecx, [ebp+esi*4+68h]
mov	[esp+528h+var_514], ecx

loc_45D7F1:				; CODE XREF: sub_45D790+57j
mov	eax, [esp+528h+var_514]
test	eax, eax
jnz	short loc_45D80E
mov	edx, [ebp+0]
push	ebp
mov	[edx+14h], edi
mov	eax, [ebp+0]
mov	[eax+18h], esi
mov	ecx, [ebp+0]
call	dword ptr [ecx]
add	esp, 4

loc_45D80E:				; CODE XREF: sub_45D790+67j
mov	esi, [esp+528h+arg_C]
cmp	dword ptr [esi], 0
jnz	short loc_45D82C
mov	edx, [ebp+4]
push	500h
push	1
push	ebp
call	dword ptr [edx]
add	esp, 0Ch
mov	[esi], eax

loc_45D82C:				; CODE XREF: sub_45D790+88j
mov	eax, [esi]
mov	ebx, 1
mov	[esp+528h+var_510], eax
xor	esi, esi
mov	[esp+528h+var_518], ebx

loc_45D83D:				; CODE XREF: sub_45D790+11Aj
mov	edx, [esp+528h+var_514]
xor	ecx, ecx
mov	cl, [ebx+edx]
mov	edi, ecx
test	edi, edi
jl	short loc_45D856
lea	eax, [edi+esi]
cmp	eax, 100h
jle	short loc_45D869

loc_45D856:				; CODE XREF: sub_45D790+BAj
mov	ecx, [ebp+0]
push	ebp
mov	dword ptr [ecx+14h], 8
mov	edx, [ebp+0]
call	dword ptr [edx]
add	esp, 4

loc_45D869:				; CODE XREF: sub_45D790+C4j
mov	eax, edi
dec	edi
test	eax, eax
jz	short loc_45D8A2
lea	ebp, [edi+1]
mov	al, bl
mov	bh, bl
lea	edx, [esp+esi+528h+var_508]
mov	ecx, ebp
mov	eax, ebx
mov	edi, edx
mov	edx, ecx
shl	eax, 10h
mov	ax, bx
mov	ebx, [esp+528h+var_518]
shr	ecx, 2
rep stosd
mov	ecx, edx
and	ecx, 3
add	esi, ebp
mov	ebp, [esp+528h+arg_0]
rep stosb

loc_45D8A2:				; CODE XREF: sub_45D790+DEj
inc	ebx
cmp	ebx, 10h
mov	[esp+528h+var_518], ebx
jle	short loc_45D83D
mov	[esp+esi+528h+var_508],	0
mov	al, [esp+528h+var_508]
mov	[esp+528h+var_518], esi
xor	edi, edi
xor	esi, esi
test	al, al
movsx	ebx, al
jz	short loc_45D90F

loc_45D8C4:				; CODE XREF: sub_45D790+17Dj
movsx	eax, [esp+esi+528h+var_508]
cmp	eax, ebx
jnz	short loc_45D8E4
lea	eax, [esp+esi*4+528h+var_404]

loc_45D8D4:				; CODE XREF: sub_45D790+152j
movsx	ecx, [esp+esi+528h+var_507]
inc	esi
mov	[eax], edi
add	eax, 4
inc	edi
cmp	ecx, ebx
jz	short loc_45D8D4

loc_45D8E4:				; CODE XREF: sub_45D790+13Bj
mov	edx, 1
mov	ecx, ebx
shl	edx, cl
cmp	edi, edx
jl	short loc_45D904
mov	eax, [ebp+0]
push	ebp
mov	dword ptr [eax+14h], 8
mov	ecx, [ebp+0]
call	dword ptr [ecx]
add	esp, 4

loc_45D904:				; CODE XREF: sub_45D790+15Fj
mov	al, [esp+esi+528h+var_508]
shl	edi, 1
inc	ebx
test	al, al
jnz	short loc_45D8C4

loc_45D90F:				; CODE XREF: sub_45D790+132j
mov	edx, [esp+528h+var_510]
mov	ecx, 40h
xor	eax, eax
lea	ebx, [edx+400h]
mov	edi, ebx
rep stosd
mov	eax, [esp+528h+arg_4]
neg	eax
sbb	eax, eax
xor	edi, edi
and	al, 10h
add	eax, 0FFh
mov	[esp+528h+var_50C], eax
mov	eax, [esp+528h+var_518]
test	eax, eax
jle	short loc_45D99C
lea	ebp, [esp+528h+var_404]

loc_45D94B:				; CODE XREF: sub_45D790+20Aj
mov	ecx, [esp+528h+var_514]
xor	eax, eax
mov	al, [ecx+edi+11h]
mov	esi, eax
test	esi, esi
jl	short loc_45D967
cmp	esi, [esp+528h+var_50C]
jg	short loc_45D967
cmp	byte ptr [ebx+esi], 0
jz	short loc_45D97F

loc_45D967:				; CODE XREF: sub_45D790+1C9j
					; sub_45D790+1CFj
mov	eax, [esp+528h+arg_0]
push	eax
mov	edx, [eax]
mov	dword ptr [edx+14h], 8
mov	ecx, [eax]
call	dword ptr [ecx]
add	esp, 4

loc_45D97F:				; CODE XREF: sub_45D790+1D5j
mov	eax, [esp+528h+var_510]
mov	edx, [ebp+0]
mov	cl, [esp+edi+528h+var_508]
inc	edi
mov	[eax+esi*4], edx
mov	eax, [esp+528h+var_518]
add	ebp, 4
cmp	edi, eax
mov	[ebx+esi], cl
jl	short loc_45D94B

loc_45D99C:				; CODE XREF: sub_45D790+1B2j
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 518h
retn
sub_45D790 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45D9B0 proc	near			; CODE XREF: sub_45E460+91p
					; sub_45E460+D0p ...

var_82D= byte ptr -82Dh
var_82C= dword ptr -82Ch
var_828= dword ptr -828h
var_824= dword ptr -824h
var_820= dword ptr -820h
var_81C= byte ptr -81Ch
var_808= dword ptr -808h
var_404= dword ptr -404h
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

sub	esp, 82Ch
mov	ecx, 8
xor	eax, eax
push	ebx
push	ebp
push	esi
push	edi
lea	edi, [esp+83Ch+var_82C]
mov	ebp, [esp+83Ch+arg_8]
rep stosd
stosb
mov	ecx, 101h
xor	eax, eax
lea	edi, [esp+83Ch+var_808]
mov	dword ptr [ebp+400h], 1
rep stosd
mov	ecx, 101h
or	eax, 0FFFFFFFFh
lea	edi, [esp+83Ch+var_404]
rep stosd

loc_45D9F7:				; CODE XREF: sub_45D9B0+F4j
					; sub_45D9B0+10Ej
or	eax, 0FFFFFFFFh
mov	edi, 3B9ACA00h
xor	ecx, ecx
mov	esi, ebp

loc_45DA03:				; CODE XREF: sub_45D9B0+6Bj
mov	edx, [esi]
test	edx, edx
jz	short loc_45DA11
cmp	edx, edi
jg	short loc_45DA11
mov	edi, edx
mov	eax, ecx

loc_45DA11:				; CODE XREF: sub_45D9B0+57j
					; sub_45D9B0+5Bj
inc	ecx
add	esi, 4
cmp	ecx, 100h
jle	short loc_45DA03
or	edx, 0FFFFFFFFh
mov	ebx, 3B9ACA00h
xor	ecx, ecx
mov	edi, ebp

loc_45DA29:				; CODE XREF: sub_45D9B0+95j
mov	esi, [edi]
test	esi, esi
jz	short loc_45DA3B
cmp	esi, ebx
jg	short loc_45DA3B
cmp	ecx, eax
jz	short loc_45DA3B
mov	ebx, esi
mov	edx, ecx

loc_45DA3B:				; CODE XREF: sub_45D9B0+7Dj
					; sub_45D9B0+81j ...
inc	ecx
add	edi, 4
cmp	ecx, 100h
jle	short loc_45DA29
test	edx, edx
jl	short loc_45DAC3
mov	ecx, [ebp+edx*4+0]
mov	ebx, [ebp+eax*4+0]
mov	edi, [esp+eax*4+83Ch+var_808]
add	ebx, ecx
mov	ecx, [esp+eax*4+83Ch+var_404]
inc	edi
mov	[ebp+eax*4+0], ebx
mov	dword ptr [ebp+edx*4+0], 0
test	ecx, ecx
mov	[esp+eax*4+83Ch+var_808], edi
jl	short loc_45DA8B

loc_45DA75:				; CODE XREF: sub_45D9B0+D9j
mov	eax, ecx
mov	edi, [esp+eax*4+83Ch+var_808]
mov	ecx, [esp+eax*4+83Ch+var_404]
inc	edi
test	ecx, ecx
mov	[esp+eax*4+83Ch+var_808], edi
jge	short loc_45DA75

loc_45DA8B:				; CODE XREF: sub_45D9B0+C3j
mov	esi, [esp+edx*4+83Ch+var_808]
mov	[esp+eax*4+83Ch+var_404], edx
mov	eax, [esp+edx*4+83Ch+var_404]
inc	esi
test	eax, eax
mov	[esp+edx*4+83Ch+var_808], esi
jl	loc_45D9F7

loc_45DAAA:				; CODE XREF: sub_45D9B0+10Cj
mov	edx, [esp+eax*4+83Ch+var_808]
inc	edx
mov	[esp+eax*4+83Ch+var_808], edx
mov	eax, [esp+eax*4+83Ch+var_404]
test	eax, eax
jge	short loc_45DAAA
jmp	loc_45D9F7
; ---------------------------------------------------------------------------

loc_45DAC3:				; CODE XREF: sub_45D9B0+99j
mov	ebx, [esp+83Ch+arg_0]
lea	edi, [esp+83Ch+var_808]
mov	ebp, 101h

loc_45DAD3:				; CODE XREF: sub_45D9B0+14Fj
mov	esi, [edi]
test	esi, esi
jz	short loc_45DAFB
cmp	esi, 20h
jle	short loc_45DAEF
mov	edx, [ebx]
push	ebx
mov	dword ptr [edx+14h], 27h
mov	eax, [ebx]
call	dword ptr [eax]
add	esp, 4

loc_45DAEF:				; CODE XREF: sub_45D9B0+12Cj
mov	cl, byte ptr [esp+esi+83Ch+var_82C]
lea	eax, [esp+esi+83Ch+var_82C]
inc	cl
mov	[eax], cl

loc_45DAFB:				; CODE XREF: sub_45D9B0+127j
add	edi, 4
dec	ebp
jnz	short loc_45DAD3
mov	edx, 20h

loc_45DB06:				; CODE XREF: sub_45D9B0+1A8j
mov	cl, byte ptr [esp+edx+83Ch+var_82C]
test	cl, cl
jbe	short loc_45DB54
lea	esi, [edx-2]

loc_45DB11:				; CODE XREF: sub_45D9B0+1A2j
mov	eax, esi
mov	bl, byte ptr [esp+eax+83Ch+var_82C]
test	bl, bl
jnz	short loc_45DB24

loc_45DB1B:				; CODE XREF: sub_45D9B0+172j
mov	bl, [esp+eax+83Ch+var_82D]
dec	eax
test	bl, bl
jz	short loc_45DB1B

loc_45DB24:				; CODE XREF: sub_45D9B0+169j
sub	cl, 2
mov	byte ptr [esp+edx+83Ch+var_82C], cl
mov	cl, [esp+edx+83Ch+var_82D]
inc	cl
mov	[esp+edx+83Ch+var_82D],	cl
mov	bl, byte ptr [esp+eax+83Ch+var_82C+1]
add	bl, 2
mov	byte ptr [esp+eax+83Ch+var_82C+1], bl
mov	cl, byte ptr [esp+eax+83Ch+var_82C]
lea	eax, [esp+eax+83Ch+var_82C]
dec	cl
mov	[eax], cl
mov	cl, byte ptr [esp+edx+83Ch+var_82C]
test	cl, cl
ja	short loc_45DB11

loc_45DB54:				; CODE XREF: sub_45D9B0+15Cj
dec	edx
cmp	edx, 10h
jg	short loc_45DB06
mov	al, byte ptr [esp+edx+83Ch+var_82C]
test	al, al
jnz	short loc_45DB6B

loc_45DB62:				; CODE XREF: sub_45D9B0+1B9j
mov	al, [esp+edx+83Ch+var_82D]
dec	edx
test	al, al
jz	short loc_45DB62

loc_45DB6B:				; CODE XREF: sub_45D9B0+1B0j
mov	cl, byte ptr [esp+edx+83Ch+var_82C]
mov	edi, [esp+83Ch+arg_4]
lea	eax, [esp+edx+83Ch+var_82C]
dec	cl
mov	esi, 1
mov	[eax], cl
mov	edx, [esp+83Ch+var_82C]
mov	eax, [esp+83Ch+var_828]
mov	ecx, edi
mov	[ecx], edx
mov	edx, [esp+83Ch+var_824]
mov	[ecx+4], eax
mov	eax, [esp+83Ch+var_820]
mov	[ecx+8], edx
mov	dl, [esp+83Ch+var_81C]
mov	[ecx+0Ch], eax
mov	[ecx+10h], dl
xor	edx, edx

loc_45DBA9:				; CODE XREF: sub_45D9B0+217j
xor	eax, eax
lea	ecx, [esp+83Ch+var_808]

loc_45DBAF:				; CODE XREF: sub_45D9B0+211j
cmp	[ecx], esi
jnz	short loc_45DBB8
mov	[edx+edi+11h], al
inc	edx

loc_45DBB8:				; CODE XREF: sub_45D9B0+201j
inc	eax
add	ecx, 4
cmp	eax, 0FFh
jle	short loc_45DBAF
inc	esi
cmp	esi, 20h
jle	short loc_45DBA9
mov	dword ptr [edi+114h], 0
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 82Ch
retn
sub_45D9B0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45DBE0 proc	near			; CODE XREF: sub_459F80:loc_459FE6p

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	6Ch
push	1
mov	eax, [esi+4]
push	esi
call	dword ptr [eax]
add	esp, 0Ch
mov	[esi+16Ch], eax
mov	dword ptr [eax], offset	sub_45DC20
add	eax, 2Ch
mov	ecx, 4
xor	edx, edx
pop	esi

loc_45DC09:				; CODE XREF: sub_45DBE0+38j
mov	[eax+10h], edx
mov	[eax], edx
mov	[eax+30h], edx
mov	[eax+20h], edx
add	eax, 4
dec	ecx
jnz	short loc_45DC09
retn
sub_45DBE0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45DC20 proc	near			; DATA XREF: sub_45DBE0+18o

var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8

mov	eax, [esp+arg_4]
sub	esp, 8
xor	edx, edx
push	ebx
push	esi
mov	esi, [esp+10h+arg_0]
cmp	eax, edx
mov	ebx, [esi+16Ch]
jz	short loc_45DC49
mov	dword ptr [ebx+4], offset sub_45E2A0
mov	dword ptr [ebx+8], offset sub_45E460
jmp	short loc_45DC57
; ---------------------------------------------------------------------------

loc_45DC49:				; CODE XREF: sub_45DC20+17j
mov	dword ptr [ebx+4], offset sub_45DD90
mov	dword ptr [ebx+8], offset sub_45E220

loc_45DC57:				; CODE XREF: sub_45DC20+27j
mov	eax, [esi+0F4h]
mov	[esp+10h+var_8], edx
cmp	eax, edx
jle	loc_45DD76
lea	eax, [ebx+14h]
lea	ecx, [esi+0F8h]
push	ebp
push	edi
mov	[esp+18h+var_4], eax
mov	[esp+18h+arg_0], ecx

loc_45DC7C:				; CODE XREF: sub_45DC20+14Ej
mov	eax, [esp+18h+arg_0]
mov	eax, [eax]
mov	edi, [eax+14h]
mov	ebp, [eax+18h]
cmp	[esp+18h+arg_4], edx
jz	loc_45DD24
cmp	edi, edx
jl	short loc_45DC9B
cmp	edi, 4
jl	short loc_45DCB1

loc_45DC9B:				; CODE XREF: sub_45DC20+74j
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 32h
mov	edx, [esi]
mov	[edx+18h], edi
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4

loc_45DCB1:				; CODE XREF: sub_45DC20+79j
test	ebp, ebp
jl	short loc_45DCBA
cmp	ebp, 4
jl	short loc_45DCD0

loc_45DCBA:				; CODE XREF: sub_45DC20+93j
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 32h
mov	edx, [esi]
mov	[edx+18h], ebp
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4

loc_45DCD0:				; CODE XREF: sub_45DC20+98j
mov	eax, [ebx+edi*4+4Ch]
test	eax, eax
jnz	short loc_45DCEC
mov	ecx, [esi+4]
push	404h
push	1
push	esi
call	dword ptr [ecx]
add	esp, 0Ch
mov	[ebx+edi*4+4Ch], eax

loc_45DCEC:				; CODE XREF: sub_45DC20+B6j
mov	edi, [ebx+edi*4+4Ch]
mov	ecx, 101h
xor	eax, eax
rep stosd
mov	eax, [ebx+ebp*4+5Ch]
test	eax, eax
jnz	short loc_45DD15
mov	edx, [esi+4]
push	404h
push	1
push	esi
call	dword ptr [edx]
add	esp, 0Ch
mov	[ebx+ebp*4+5Ch], eax

loc_45DD15:				; CODE XREF: sub_45DC20+DFj
mov	edi, [ebx+ebp*4+5Ch]
mov	ecx, 101h
xor	eax, eax
rep stosd
jmp	short loc_45DD43
; ---------------------------------------------------------------------------

loc_45DD24:				; CODE XREF: sub_45DC20+6Cj
lea	eax, [ebx+edi*4+2Ch]
push	eax
push	edi
push	1
push	esi
call	sub_45D790
lea	ecx, [ebx+ebp*4+3Ch]
push	ecx
push	ebp
push	0
push	esi
call	sub_45D790
add	esp, 20h

loc_45DD43:				; CODE XREF: sub_45DC20+102j
mov	ecx, [esp+18h+var_4]
mov	eax, [esp+18h+var_8]
mov	ebp, [esp+18h+arg_0]
xor	edx, edx
mov	[ecx], edx
add	ecx, 4
mov	[esp+18h+var_4], ecx
mov	ecx, [esi+0F4h]
inc	eax
add	ebp, 4
cmp	eax, ecx
mov	[esp+18h+var_8], eax
mov	[esp+18h+arg_0], ebp
jl	loc_45DC7C
pop	edi
pop	ebp

loc_45DD76:				; CODE XREF: sub_45DC20+43j
mov	[ebx+0Ch], edx
mov	[ebx+10h], edx
mov	eax, [esi+0C8h]
mov	[ebx+28h], edx
mov	[ebx+24h], eax
pop	esi
pop	ebx
add	esp, 8
retn
sub_45DC20 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45DD90 proc	near			; DATA XREF: sub_45DC20:loc_45DC49o

var_28=	dword ptr -28h
var_24=	dword ptr -24h
var_20=	dword ptr -20h
var_1C=	byte ptr -1Ch
var_14=	byte ptr -14h
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8

sub	esp, 28h
push	ebx
mov	ebx, [esp+2Ch+arg_0]
push	ebp
push	esi
mov	eax, [ebx+18h]
mov	ebp, [ebx+16Ch]
push	edi
lea	edi, [esp+38h+var_1C]
mov	ecx, [eax]
lea	esi, [ebp+0Ch]
mov	[esp+38h+var_24], ecx
mov	edx, [eax+4]
mov	eax, [ebx+0C8h]
mov	ecx, 6
mov	[esp+38h+var_20], edx
rep movsd
test	eax, eax
mov	[esp+38h+var_4], ebx
jz	short loc_45DDF3
mov	eax, [ebp+24h]
test	eax, eax
jnz	short loc_45DDF3
mov	eax, [ebp+28h]
lea	ecx, [esp+38h+var_24]
push	eax
push	ecx
call	sub_45E160
add	esp, 8
test	eax, eax
jnz	short loc_45DDF3

loc_45DDE9:				; CODE XREF: sub_45DD90+B9j
pop	edi
pop	esi
pop	ebp
xor	eax, eax
pop	ebx
add	esp, 28h
retn
; ---------------------------------------------------------------------------

loc_45DDF3:				; CODE XREF: sub_45DD90+3Bj
					; sub_45DD90+42j ...
mov	eax, [ebx+110h]
mov	[esp+38h+var_28], 0
test	eax, eax
jle	short loc_45DE73
mov	esi, [esp+38h+arg_4]
lea	edx, [ebx+114h]
mov	[esp+38h+arg_0], edx

loc_45DE13:				; CODE XREF: sub_45DD90+E1j
mov	eax, [esp+38h+arg_0]
mov	eax, [eax]
mov	ecx, [ebx+eax*4+0F8h]
lea	edi, [esp+eax*4+38h+var_14]
mov	edx, [ecx+18h]
mov	ecx, [ecx+14h]
mov	eax, [ebp+edx*4+3Ch]
mov	edx, [ebp+ecx*4+2Ch]
mov	ecx, [esi]
push	eax
mov	eax, [edi]
push	edx
push	eax
lea	edx, [esp+44h+var_24]
push	ecx
push	edx
call	sub_45DED0
add	esp, 14h
test	eax, eax
jz	short loc_45DDE9
mov	eax, [esi]
add	esi, 4
movsx	ecx, word ptr [eax]
mov	eax, [esp+38h+var_28]
mov	[edi], ecx
mov	edi, [esp+38h+arg_0]
mov	ecx, [ebx+110h]
inc	eax
add	edi, 4
cmp	eax, ecx
mov	[esp+38h+var_28], eax
mov	[esp+38h+arg_0], edi
jl	short loc_45DE13

loc_45DE73:				; CODE XREF: sub_45DD90+73j
mov	edx, [ebx+18h]
mov	eax, [esp+38h+var_24]
lea	esi, [esp+38h+var_1C]
lea	edi, [ebp+0Ch]
mov	[edx], eax
mov	ecx, [ebx+18h]
mov	edx, [esp+38h+var_20]
mov	[ecx+4], edx
mov	ecx, 6
rep movsd
mov	ebx, [ebx+0C8h]
test	ebx, ebx
jz	short loc_45DEB5
mov	eax, [ebp+24h]
test	eax, eax
jnz	short loc_45DEB2
mov	eax, [ebp+28h]
mov	[ebp+24h], ebx
inc	eax
and	eax, 7
mov	[ebp+28h], eax

loc_45DEB2:				; CODE XREF: sub_45DD90+113j
dec	dword ptr [ebp+24h]

loc_45DEB5:				; CODE XREF: sub_45DD90+10Cj
pop	edi
pop	esi
pop	ebp
mov	eax, 1
pop	ebx
add	esp, 28h
retn
sub_45DD90 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45DED0 proc	near			; CODE XREF: sub_45DD90+AFp

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h

mov	eax, [esp+arg_4]
push	ebx
push	ebp
push	esi
push	edi
movsx	edi, word ptr [eax]
sub	edi, [esp+10h+arg_8]
mov	eax, edi
jns	short loc_45DEE6
neg	eax
dec	edi

loc_45DEE6:				; CODE XREF: sub_45DED0+11j
mov	ebp, [esp+10h+arg_0]
xor	esi, esi
test	eax, eax
jz	short loc_45DF11

loc_45DEF0:				; CODE XREF: sub_45DED0+23j
inc	esi
sar	eax, 1
jnz	short loc_45DEF0
cmp	esi, 0Bh
jle	short loc_45DF11
mov	ecx, [ebp+20h]
mov	edx, [ecx]
mov	dword ptr [edx+14h], 6
mov	eax, [ebp+20h]
push	eax
mov	ecx, [eax]
call	dword ptr [ecx]
add	esp, 4

loc_45DF11:				; CODE XREF: sub_45DED0+1Ej
					; sub_45DED0+28j
mov	eax, [esp+10h+arg_C]
movsx	edx, byte ptr [esi+eax+400h]
mov	eax, [eax+esi*4]
push	edx
push	eax
push	ebp
call	sub_45E060
add	esp, 0Ch
test	eax, eax
jnz	short loc_45DF34
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_45DF34:				; CODE XREF: sub_45DED0+5Dj
test	esi, esi
jz	short loc_45DF4C
push	esi
push	edi
push	ebp
call	sub_45E060
add	esp, 0Ch
test	eax, eax
jnz	short loc_45DF4C
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_45DF4C:				; CODE XREF: sub_45DED0+66j
					; sub_45DED0+75j
mov	eax, (offset dword_479024+4)
xor	esi, esi
mov	[esp+10h+arg_0], eax

loc_45DF57:				; CODE XREF: sub_45DED0+151j
mov	ecx, [eax]
mov	edx, [esp+10h+arg_4]
movsx	edi, word ptr [edx+ecx*2]
test	edi, edi
jnz	short loc_45DF6B
inc	esi
jmp	loc_45E015
; ---------------------------------------------------------------------------

loc_45DF6B:				; CODE XREF: sub_45DED0+93j
cmp	esi, 0Fh
jle	short loc_45DF9C

loc_45DF70:				; CODE XREF: sub_45DED0+CAj
mov	eax, [esp+10h+arg_10]
movsx	ecx, byte ptr [eax+4F0h]
mov	edx, [eax+3C0h]
push	ecx
push	edx
push	ebp
call	sub_45E060
add	esp, 0Ch
test	eax, eax
jz	loc_45E047
sub	esi, 10h
cmp	esi, 0Fh
jg	short loc_45DF70

loc_45DF9C:				; CODE XREF: sub_45DED0+9Ej
test	edi, edi
mov	[esp+10h+arg_8], edi
jge	short loc_45DFAF
mov	eax, [esp+10h+arg_8]
neg	edi
dec	eax
mov	[esp+10h+arg_8], eax

loc_45DFAF:				; CODE XREF: sub_45DED0+D2j
sar	edi, 1
mov	ebx, 1
jz	short loc_45DFD9

loc_45DFB8:				; CODE XREF: sub_45DED0+EBj
inc	ebx
sar	edi, 1
jnz	short loc_45DFB8
cmp	ebx, 0Ah
jle	short loc_45DFD9
mov	eax, [ebp+20h]
mov	ecx, [eax]
mov	dword ptr [ecx+14h], 6
mov	eax, [ebp+20h]
push	eax
mov	edx, [eax]
call	dword ptr [edx]
add	esp, 4

loc_45DFD9:				; CODE XREF: sub_45DED0+E6j
					; sub_45DED0+F0j
mov	eax, [esp+10h+arg_10]
shl	esi, 4
add	esi, ebx
movsx	ecx, byte ptr [esi+eax+400h]
mov	edx, [eax+esi*4]
push	ecx
push	edx
push	ebp
call	sub_45E060
add	esp, 0Ch
test	eax, eax
jz	short loc_45E047
mov	eax, [esp+10h+arg_8]
push	ebx
push	eax
push	ebp
call	sub_45E060
add	esp, 0Ch
test	eax, eax
jz	short loc_45E047
mov	eax, [esp+10h+arg_0]
xor	esi, esi

loc_45E015:				; CODE XREF: sub_45DED0+96j
add	eax, 4
cmp	eax, (offset dword_479024+100h)
mov	[esp+10h+arg_0], eax
jl	loc_45DF57
test	esi, esi
jle	short loc_45E04E
mov	eax, [esp+10h+arg_10]
movsx	ecx, byte ptr [eax+400h]
mov	edx, [eax]
push	ecx
push	edx
push	ebp
call	sub_45E060
add	esp, 0Ch
test	eax, eax
jnz	short loc_45E04E

loc_45E047:				; CODE XREF: sub_45DED0+BEj
					; sub_45DED0+12Aj ...
pop	edi
pop	esi
pop	ebp
xor	eax, eax
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_45E04E:				; CODE XREF: sub_45DED0+159j
					; sub_45DED0+175j
pop	edi
pop	esi
pop	ebp
mov	eax, 1
pop	ebx
retn
sub_45DED0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45E060 proc	near			; CODE XREF: sub_45DED0+53p
					; sub_45DED0+6Bp ...

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

push	ebx
mov	ebx, [esp+4+arg_8]
push	ebp
push	esi
mov	esi, [esp+0Ch+arg_0]
push	edi
test	ebx, ebx
mov	ebp, [esi+0Ch]
jnz	short loc_45E08A
mov	eax, [esi+20h]
mov	ecx, [eax]
mov	dword ptr [ecx+14h], 28h
mov	eax, [esi+20h]
push	eax
mov	edx, [eax]
call	dword ptr [edx]
add	esp, 4

loc_45E08A:				; CODE XREF: sub_45E060+11j
mov	eax, [esp+10h+arg_4]
mov	edi, 1
mov	ecx, ebx
add	ebp, ebx
shl	edi, cl
mov	ecx, 18h
sub	ecx, ebp
dec	edi
and	edi, eax
shl	edi, cl
mov	ecx, [esi+8]
or	edi, ecx
cmp	ebp, 8
mov	[esp+10h+arg_0], edi
jl	short loc_45E10F

loc_45E0B3:				; CODE XREF: sub_45E060+ADj
mov	eax, [esi]
xor	ebx, ebx
mov	bl, byte ptr [esp+10h+arg_0+2]
mov	[eax], bl
mov	ecx, [esi]
mov	eax, [esi+4]
inc	ecx
dec	eax
mov	[esi], ecx
mov	[esi+4], eax
jnz	short loc_45E0D8
push	esi
call	sub_45E130
add	esp, 4
test	eax, eax
jz	short loc_45E11F

loc_45E0D8:				; CODE XREF: sub_45E060+69j
cmp	ebx, 0FFh
jnz	short loc_45E100
mov	ecx, [esi]
mov	byte ptr [ecx],	0
mov	ecx, [esi]
mov	eax, [esi+4]
inc	ecx
dec	eax
mov	[esi], ecx
mov	[esi+4], eax
jnz	short loc_45E100
push	esi
call	sub_45E130
add	esp, 4
test	eax, eax
jz	short loc_45E11F

loc_45E100:				; CODE XREF: sub_45E060+7Ej
					; sub_45E060+91j
sub	ebp, 8
shl	edi, 8
cmp	ebp, 8
mov	[esp+10h+arg_0], edi
jge	short loc_45E0B3

loc_45E10F:				; CODE XREF: sub_45E060+51j
mov	[esi+8], edi
mov	[esi+0Ch], ebp
pop	edi
pop	esi
pop	ebp
mov	eax, 1
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_45E11F:				; CODE XREF: sub_45E060+76j
					; sub_45E060+9Ej
pop	edi
pop	esi
pop	ebp
xor	eax, eax
pop	ebx
retn
sub_45E060 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45E130 proc	near			; CODE XREF: sub_45E060+6Cp
					; sub_45E060+94p ...

arg_0= dword ptr  4

push	esi
push	edi
mov	edi, [esp+8+arg_0]
mov	eax, [edi+20h]
push	eax
mov	esi, [eax+18h]
call	dword ptr [esi+0Ch]
add	esp, 4
test	eax, eax
jnz	short loc_45E14A
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45E14A:				; CODE XREF: sub_45E130+15j
mov	eax, [esi]
mov	[edi], eax
mov	ecx, [esi+4]
mov	[edi+4], ecx
pop	edi
mov	eax, 1
pop	esi
retn
sub_45E130 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45E160 proc	near			; CODE XREF: sub_45DD90+4Dp

arg_0= dword ptr  4
arg_4= byte ptr	 8

push	esi
mov	esi, [esp+4+arg_0]
push	esi
call	sub_45E1F0
add	esp, 4
test	eax, eax
jnz	short loc_45E174
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45E174:				; CODE XREF: sub_45E160+10j
mov	eax, [esi]
mov	byte ptr [eax],	0FFh
mov	ecx, [esi]
mov	eax, [esi+4]
inc	ecx
dec	eax
mov	[esi], ecx
mov	[esi+4], eax
jnz	short loc_45E196
push	esi
call	sub_45E130
add	esp, 4
test	eax, eax
jnz	short loc_45E196
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45E196:				; CODE XREF: sub_45E160+25j
					; sub_45E160+32j
mov	cl, [esp+4+arg_4]
mov	edx, [esi]
sub	cl, 30h
mov	[edx], cl
mov	ecx, [esi]
mov	eax, [esi+4]
inc	ecx
dec	eax
mov	[esi], ecx
mov	[esi+4], eax
jnz	short loc_45E1BE
push	esi
call	sub_45E130
add	esp, 4
test	eax, eax
jnz	short loc_45E1BE
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45E1BE:				; CODE XREF: sub_45E160+4Dj
					; sub_45E160+5Aj
mov	ecx, [esi+20h]
xor	eax, eax
mov	edx, [ecx+0F4h]
test	edx, edx
jle	short loc_45E1E5
lea	ecx, [esi+10h]

loc_45E1D0:				; CODE XREF: sub_45E160+83j
mov	dword ptr [ecx], 0
mov	edx, [esi+20h]
inc	eax
add	ecx, 4
cmp	eax, [edx+0F4h]
jl	short loc_45E1D0

loc_45E1E5:				; CODE XREF: sub_45E160+6Bj
mov	eax, 1
pop	esi
retn
sub_45E160 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45E1F0 proc	near			; CODE XREF: sub_45E160+6p
					; sub_45E220+3Ap

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	7
push	7Fh
push	esi
call	sub_45E060
add	esp, 0Ch
test	eax, eax
jnz	short loc_45E208
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45E208:				; CODE XREF: sub_45E1F0+14j
xor	eax, eax
mov	[esi+8], eax
mov	[esi+0Ch], eax
mov	eax, 1
pop	esi
retn
sub_45E1F0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45E220 proc	near			; DATA XREF: sub_45DC20+30o

var_24=	dword ptr -24h
var_20=	dword ptr -20h
var_1C=	byte ptr -1Ch
var_4= dword ptr -4
arg_0= dword ptr  4

sub	esp, 24h
push	ebx
mov	ebx, [esp+28h+arg_0]
push	ebp
push	esi
mov	eax, [ebx+18h]
mov	ecx, [ebx+16Ch]
push	edi
lea	edi, [esp+34h+var_1C]
mov	edx, [eax]
lea	ebp, [ecx+0Ch]
mov	[esp+34h+var_24], edx
mov	eax, [eax+4]
mov	ecx, 6
mov	esi, ebp
mov	[esp+34h+var_20], eax
rep movsd
lea	ecx, [esp+34h+var_24]
mov	[esp+34h+var_4], ebx
push	ecx
call	sub_45E1F0
add	esp, 4
test	eax, eax
jnz	short loc_45E277
mov	edx, [ebx]
push	ebx
mov	dword ptr [edx+14h], 18h
mov	eax, [ebx]
call	dword ptr [eax]
add	esp, 4

loc_45E277:				; CODE XREF: sub_45E220+44j
mov	ecx, [ebx+18h]
mov	edx, [esp+34h+var_24]
lea	esi, [esp+34h+var_1C]
mov	edi, ebp
mov	[ecx], edx
mov	eax, [ebx+18h]
mov	ecx, [esp+34h+var_20]
mov	[eax+4], ecx
mov	ecx, 6
rep movsd
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 24h
retn
sub_45E220 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45E2A0 proc	near			; DATA XREF: sub_45DC20+19o

var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8

push	ecx
push	esi
mov	esi, [esp+8+arg_0]
push	edi
mov	eax, [esi+0C8h]
mov	edi, [esi+16Ch]
test	eax, eax
jz	short loc_45E2ED
mov	eax, [edi+24h]
test	eax, eax
jnz	short loc_45E2EA
mov	ecx, [esi+0F4h]
xor	eax, eax
test	ecx, ecx
jle	short loc_45E2E1
lea	ecx, [edi+14h]

loc_45E2CD:				; CODE XREF: sub_45E2A0+3Fj
mov	dword ptr [ecx], 0
mov	edx, [esi+0F4h]
inc	eax
add	ecx, 4
cmp	eax, edx
jl	short loc_45E2CD

loc_45E2E1:				; CODE XREF: sub_45E2A0+28j
mov	eax, [esi+0C8h]
mov	[edi+24h], eax

loc_45E2EA:				; CODE XREF: sub_45E2A0+1Cj
dec	dword ptr [edi+24h]

loc_45E2ED:				; CODE XREF: sub_45E2A0+15j
mov	eax, [esi+110h]
mov	[esp+0Ch+var_4], 0
test	eax, eax
jle	short loc_45E374
push	ebx
lea	ecx, [esi+114h]
push	ebp
mov	ebp, [esp+14h+arg_4]
mov	[esp+14h+arg_0], ecx

loc_45E30F:				; CODE XREF: sub_45E2A0+C7j
mov	edx, [esp+14h+arg_0]
mov	ebx, [edx]
mov	eax, [esi+ebx*4+0F8h]
mov	ecx, [eax+18h]
mov	eax, [eax+14h]
mov	edx, [edi+ecx*4+5Ch]
mov	ecx, [edi+eax*4+4Ch]
mov	eax, [ebp+0]
push	edx
mov	edx, [edi+ebx*4+14h]
push	ecx
push	edx
push	eax
push	esi
call	sub_45E380
mov	ecx, [ebp+0]
mov	eax, [esp+28h+var_4]
add	esp, 14h
inc	eax
movsx	edx, word ptr [ecx]
mov	[edi+ebx*4+14h], edx
mov	ebx, [esp+14h+arg_0]
mov	ecx, [esi+110h]
add	ebx, 4
add	ebp, 4
cmp	eax, ecx
mov	[esp+14h+var_4], eax
mov	[esp+14h+arg_0], ebx
jl	short loc_45E30F
pop	ebp
pop	ebx
pop	edi
mov	eax, 1
pop	esi
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_45E374:				; CODE XREF: sub_45E2A0+5Dj
pop	edi
mov	eax, 1
pop	esi
pop	ecx
retn
sub_45E2A0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45E380 proc	near			; CODE XREF: sub_45E2A0+96p

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h

mov	eax, [esp+arg_4]
mov	ecx, [esp+arg_8]
movsx	eax, word ptr [eax]
sub	eax, ecx
jns	short loc_45E391
neg	eax

loc_45E391:				; CODE XREF: sub_45E380+Dj
push	ebx
push	ebp
push	esi
xor	esi, esi
test	eax, eax
push	edi
jz	short loc_45E3BA

loc_45E39B:				; CODE XREF: sub_45E380+1Ej
inc	esi
sar	eax, 1
jnz	short loc_45E39B
cmp	esi, 0Bh
jle	short loc_45E3BA
mov	eax, [esp+10h+arg_0]
push	eax
mov	ecx, [eax]
mov	dword ptr [ecx+14h], 6
mov	edx, [eax]
call	dword ptr [edx]
add	esp, 4

loc_45E3BA:				; CODE XREF: sub_45E380+19j
					; sub_45E380+23j
mov	eax, [esp+10h+arg_C]
mov	ebx, [esp+10h+arg_10]
mov	ebp, (offset dword_479024+4)
mov	ecx, [eax+esi*4]
inc	ecx
xor	edi, edi
mov	[eax+esi*4], ecx

loc_45E3D0:				; CODE XREF: sub_45E380+CCj
mov	eax, [ebp+0]
mov	ecx, [esp+10h+arg_4]
movsx	eax, word ptr [ecx+eax*2]
test	eax, eax
jnz	short loc_45E3E2
inc	edi
jmp	short loc_45E443
; ---------------------------------------------------------------------------

loc_45E3E2:				; CODE XREF: sub_45E380+5Dj
cmp	edi, 0Fh
jle	short loc_45E405
mov	ecx, edi
shr	ecx, 4
mov	edx, ecx
neg	edx
shl	edx, 4
add	edi, edx

loc_45E3F5:				; CODE XREF: sub_45E380+83j
mov	esi, [ebx+3C0h]
inc	esi
dec	ecx
mov	[ebx+3C0h], esi
jnz	short loc_45E3F5

loc_45E405:				; CODE XREF: sub_45E380+65j
test	eax, eax
jge	short loc_45E40B
neg	eax

loc_45E40B:				; CODE XREF: sub_45E380+87j
sar	eax, 1
mov	esi, 1
jz	short loc_45E433

loc_45E414:				; CODE XREF: sub_45E380+97j
inc	esi
sar	eax, 1
jnz	short loc_45E414
cmp	esi, 0Ah
jle	short loc_45E433
mov	eax, [esp+10h+arg_0]
push	eax
mov	ecx, [eax]
mov	dword ptr [ecx+14h], 6
mov	edx, [eax]
call	dword ptr [edx]
add	esp, 4

loc_45E433:				; CODE XREF: sub_45E380+92j
					; sub_45E380+9Cj
shl	edi, 4
add	edi, esi
mov	ecx, [ebx+edi*4]
lea	eax, [ebx+edi*4]
inc	ecx
xor	edi, edi
mov	[eax], ecx

loc_45E443:				; CODE XREF: sub_45E380+60j
add	ebp, 4
cmp	ebp, (offset dword_479024+100h)
jl	short loc_45E3D0
test	edi, edi
jle	short loc_45E454
inc	dword ptr [ebx]

loc_45E454:				; CODE XREF: sub_45E380+D0j
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
sub_45E380 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45E460 proc	near			; DATA XREF: sub_45DC20+20o

var_28=	dword ptr -28h
var_24=	dword ptr -24h
var_20=	dword ptr -20h
var_1C=	dword ptr -1Ch
var_18=	dword ptr -18h
var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4

sub	esp, 28h
push	esi
mov	esi, [esp+2Ch+arg_0]
xor	ecx, ecx
xor	edx, edx
mov	eax, [esi+16Ch]
mov	[esp+2Ch+var_20], ecx
mov	[esp+2Ch+var_10], edx
mov	[esp+2Ch+var_28], eax
mov	eax, [esi+0F4h]
mov	[esp+2Ch+var_1C], ecx
mov	[esp+2Ch+var_C], edx
mov	[esp+2Ch+var_18], ecx
mov	[esp+2Ch+var_8], edx
mov	[esp+2Ch+var_14], ecx
test	eax, eax
mov	[esp+2Ch+var_4], edx
mov	[esp+2Ch+var_24], edx
jle	loc_45E563
push	ebx
lea	eax, [esi+0F8h]
push	ebp
push	edi
mov	[esp+38h+arg_0], eax

loc_45E4B5:				; CODE XREF: sub_45E460+FAj
mov	ecx, [esp+38h+arg_0]
mov	eax, [ecx]
mov	edi, [eax+14h]
mov	ebx, [eax+18h]
mov	eax, [esp+edi*4+38h+var_20]
lea	ebp, [esp+edi*4+38h+var_20]
test	eax, eax
jnz	short loc_45E500
mov	eax, [esi+edi*4+58h]
test	eax, eax
jnz	short loc_45E4E2
push	esi
call	sub_459670
add	esp, 4
mov	[esi+edi*4+58h], eax

loc_45E4E2:				; CODE XREF: sub_45E460+73j
mov	edx, [esp+38h+var_28]
mov	ecx, [esi+edi*4+58h]
mov	eax, [edx+edi*4+4Ch]
push	eax
push	ecx
push	esi
call	sub_45D9B0
add	esp, 0Ch
mov	dword ptr [ebp+0], 1

loc_45E500:				; CODE XREF: sub_45E460+6Bj
mov	eax, [esp+ebx*4+38h+var_10]
lea	edi, [esp+ebx*4+38h+var_10]
test	eax, eax
jnz	short loc_45E53E
mov	eax, [esi+ebx*4+68h]
test	eax, eax
jnz	short loc_45E521
push	esi
call	sub_459670
add	esp, 4
mov	[esi+ebx*4+68h], eax

loc_45E521:				; CODE XREF: sub_45E460+B2j
mov	edx, [esp+38h+var_28]
mov	ecx, [esi+ebx*4+68h]
mov	eax, [edx+ebx*4+5Ch]
push	eax
push	ecx
push	esi
call	sub_45D9B0
add	esp, 0Ch
mov	dword ptr [edi], 1

loc_45E53E:				; CODE XREF: sub_45E460+AAj
mov	eax, [esp+38h+var_24]
mov	edx, [esp+38h+arg_0]
mov	ecx, [esi+0F4h]
inc	eax
add	edx, 4
cmp	eax, ecx
mov	[esp+38h+var_24], eax
mov	[esp+38h+arg_0], edx
jl	loc_45E4B5
pop	edi
pop	ebp
pop	ebx

loc_45E563:				; CODE XREF: sub_45E460+42j
pop	esi
add	esp, 28h
retn
sub_45E460 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45E570 proc	near			; CODE XREF: sub_459F80+5Fp

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	6Ch
push	1
mov	eax, [esi+4]
push	esi
call	dword ptr [eax]
add	esp, 0Ch
mov	[esi+16Ch], eax
mov	dword ptr [eax], offset	sub_45E5B0
lea	ecx, [eax+5Ch]
mov	edx, 4
xor	esi, esi

loc_45E598:				; CODE XREF: sub_45E570+31j
mov	[ecx-10h], esi
mov	[ecx], esi
add	ecx, 4
dec	edx
jnz	short loc_45E598
mov	[eax+40h], esi
pop	esi
retn
sub_45E570 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45E5B0 proc	near			; DATA XREF: sub_45E570+18o

var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8

sub	esp, 8
push	ebx
push	ebp
push	esi
mov	esi, [esp+14h+arg_0]
push	edi
mov	edi, [esp+18h+arg_4]
mov	ebx, [esi+16Ch]
xor	ebp, ebp
xor	eax, eax
mov	[ebx+20h], esi
mov	[ebx+0Ch], edi
mov	edx, [esi+13Ch]
mov	ecx, [esi+144h]
cmp	edx, ebp
setz	al
cmp	ecx, ebp
mov	[esp+18h+var_8], eax
jnz	short loc_45E5FE
cmp	eax, ebp
jz	short loc_45E5F5
mov	dword ptr [ebx+4], offset sub_45E740
jmp	short loc_45E62C
; ---------------------------------------------------------------------------

loc_45E5F5:				; CODE XREF: sub_45E5B0+3Aj
mov	dword ptr [ebx+4], offset sub_45EBA0
jmp	short loc_45E62C
; ---------------------------------------------------------------------------

loc_45E5FE:				; CODE XREF: sub_45E5B0+36j
cmp	eax, ebp
jz	short loc_45E60B
mov	dword ptr [ebx+4], offset sub_45ED80
jmp	short loc_45E62C
; ---------------------------------------------------------------------------

loc_45E60B:				; CODE XREF: sub_45E5B0+50j
mov	eax, [ebx+40h]
mov	dword ptr [ebx+4], offset sub_45EE40
cmp	eax, ebp
jnz	short loc_45E62C
mov	eax, [esi+4]
push	3E8h
push	1
push	esi
call	dword ptr [eax]
add	esp, 0Ch
mov	[ebx+40h], eax

loc_45E62C:				; CODE XREF: sub_45E5B0+43j
					; sub_45E5B0+4Cj ...
cmp	edi, ebp
jz	short loc_45E639
mov	dword ptr [ebx+8], offset sub_45F0B0
jmp	short loc_45E640
; ---------------------------------------------------------------------------

loc_45E639:				; CODE XREF: sub_45E5B0+7Ej
mov	dword ptr [ebx+8], offset sub_45F070

loc_45E640:				; CODE XREF: sub_45E5B0+87j
mov	eax, [esi+0F4h]
mov	[esp+18h+var_4], ebp
cmp	eax, ebp
jle	loc_45E716
lea	ecx, [ebx+24h]
lea	ebp, [esi+0F8h]
mov	[esp+18h+arg_0], ecx

loc_45E65F:				; CODE XREF: sub_45E5B0+15Ej
mov	edx, [esp+18h+arg_0]
mov	ecx, [esp+18h+var_8]
mov	eax, [ebp+0]
test	ecx, ecx
mov	dword ptr [edx], 0
jz	short loc_45E683
mov	ecx, [esi+144h]
test	ecx, ecx
jnz	short loc_45E6EF
mov	edi, [eax+14h]
jmp	short loc_45E689
; ---------------------------------------------------------------------------

loc_45E683:				; CODE XREF: sub_45E5B0+C2j
mov	edi, [eax+18h]
mov	[ebx+34h], edi

loc_45E689:				; CODE XREF: sub_45E5B0+D1j
mov	eax, [esp+18h+arg_4]
test	eax, eax
jz	short loc_45E6DB
test	edi, edi
jl	short loc_45E69A
cmp	edi, 4
jl	short loc_45E6B0

loc_45E69A:				; CODE XREF: sub_45E5B0+E3j
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 32h
mov	ecx, [esi]
mov	[ecx+18h], edi
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4

loc_45E6B0:				; CODE XREF: sub_45E5B0+E8j
mov	eax, [ebx+edi*4+5Ch]
test	eax, eax
jnz	short loc_45E6CC
mov	eax, [esi+4]
push	404h
push	1
push	esi
call	dword ptr [eax]
add	esp, 0Ch
mov	[ebx+edi*4+5Ch], eax

loc_45E6CC:				; CODE XREF: sub_45E5B0+106j
mov	edi, [ebx+edi*4+5Ch]
mov	ecx, 101h
xor	eax, eax
rep stosd
jmp	short loc_45E6EF
; ---------------------------------------------------------------------------

loc_45E6DB:				; CODE XREF: sub_45E5B0+DFj
mov	edx, [esp+18h+var_8]
lea	ecx, [ebx+edi*4+4Ch]
push	ecx
push	edi
push	edx
push	esi
call	sub_45D790
add	esp, 10h

loc_45E6EF:				; CODE XREF: sub_45E5B0+CCj
					; sub_45E5B0+129j
mov	eax, [esp+18h+var_4]
mov	edx, [esp+18h+arg_0]
mov	ecx, [esi+0F4h]
inc	eax
add	ebp, 4
add	edx, 4
cmp	eax, ecx
mov	[esp+18h+var_4], eax
mov	[esp+18h+arg_0], edx
jl	loc_45E65F
xor	ebp, ebp

loc_45E716:				; CODE XREF: sub_45E5B0+9Cj
mov	[ebx+38h], ebp
mov	[ebx+3Ch], ebp
mov	[ebx+18h], ebp
mov	[ebx+1Ch], ebp
mov	eax, [esi+0C8h]
pop	edi
mov	[ebx+48h], ebp
pop	esi
mov	[ebx+44h], eax
pop	ebp
pop	ebx
add	esp, 8
retn
sub_45E5B0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45E740 proc	near			; DATA XREF: sub_45E5B0+3Co

var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8

sub	esp, 0Ch
push	ebp
mov	ebp, [esp+10h+arg_0]
push	esi
push	edi
mov	eax, [ebp+18h]
mov	edi, [ebp+16Ch]
mov	esi, [ebp+148h]
mov	ecx, [eax]
mov	[edi+10h], ecx
mov	edx, [ebp+18h]
mov	eax, [edx+4]
mov	[edi+14h], eax
mov	eax, [ebp+0C8h]
test	eax, eax
jz	short loc_45E785
mov	eax, [edi+44h]
test	eax, eax
jnz	short loc_45E785
mov	ecx, [edi+48h]
push	ecx
push	edi
call	sub_45EA10
add	esp, 8

loc_45E785:				; CODE XREF: sub_45E740+2Fj
					; sub_45E740+36j
mov	eax, [ebp+110h]
mov	[esp+18h+var_C], 0
test	eax, eax
jle	loc_45E85D
mov	eax, [esp+18h+arg_4]
lea	ecx, [ebp+114h]
movsx	edx, si
push	ebx
mov	[esp+1Ch+var_8], edx
mov	[esp+1Ch+arg_4], eax
mov	[esp+1Ch+arg_0], ecx

loc_45E7B5:				; CODE XREF: sub_45E740+116j
mov	edx, [esp+1Ch+arg_0]
mov	ecx, [esp+1Ch+arg_4]
mov	esi, [edx]
mov	edx, [ecx]
mov	cl, byte ptr [esp+1Ch+var_8]
movsx	edx, word ptr [edx]
mov	eax, [ebp+esi*4+0F8h]
sar	edx, cl
mov	ecx, [edi+esi*4+24h]
mov	[esp+1Ch+var_4], eax
mov	eax, edx
mov	[edi+esi*4+24h], edx
sub	eax, ecx
mov	ebx, eax
jns	short loc_45E7E8
neg	eax
dec	ebx

loc_45E7E8:				; CODE XREF: sub_45E740+A3j
xor	esi, esi
test	eax, eax
jz	short loc_45E80B

loc_45E7EE:				; CODE XREF: sub_45E740+B1j
inc	esi
sar	eax, 1
jnz	short loc_45E7EE
cmp	esi, 0Bh
jle	short loc_45E80B
mov	eax, [ebp+0]
push	ebp
mov	dword ptr [eax+14h], 6
mov	ecx, [ebp+0]
call	dword ptr [ecx]
add	esp, 4

loc_45E80B:				; CODE XREF: sub_45E740+ACj
					; sub_45E740+B6j
mov	edx, [esp+1Ch+var_4]
push	esi
mov	eax, [edx+14h]
push	eax
push	edi
call	sub_45E9C0
add	esp, 0Ch
test	esi, esi
jz	short loc_45E82C
push	esi
push	ebx
push	edi
call	sub_45E8A0
add	esp, 0Ch

loc_45E82C:				; CODE XREF: sub_45E740+DFj
mov	esi, [esp+1Ch+arg_0]
mov	edx, [esp+1Ch+arg_4]
mov	eax, [esp+1Ch+var_C]
mov	ecx, 4
add	esi, ecx
add	edx, ecx
mov	ecx, [ebp+110h]
inc	eax
cmp	eax, ecx
mov	[esp+1Ch+var_C], eax
mov	[esp+1Ch+arg_0], esi
mov	[esp+1Ch+arg_4], edx
jl	loc_45E7B5
pop	ebx

loc_45E85D:				; CODE XREF: sub_45E740+55j
mov	ecx, [ebp+18h]
mov	edx, [edi+10h]
mov	[ecx], edx
mov	eax, [ebp+18h]
mov	ecx, [edi+14h]
mov	[eax+4], ecx
mov	ebp, [ebp+0C8h]
test	ebp, ebp
jz	short loc_45E88F
mov	eax, [edi+44h]
test	eax, eax
jnz	short loc_45E88C
mov	edx, [edi+48h]
mov	[edi+44h], ebp
inc	edx
and	edx, 7
mov	[edi+48h], edx

loc_45E88C:				; CODE XREF: sub_45E740+13Dj
dec	dword ptr [edi+44h]

loc_45E88F:				; CODE XREF: sub_45E740+136j
pop	edi
pop	esi
mov	eax, 1
pop	ebp
add	esp, 0Ch
retn
sub_45E740 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45E8A0 proc	near			; CODE XREF: sub_45E740+E4p
					; sub_45E9C0+3Cp ...

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

push	ebx
mov	ebx, [esp+4+arg_8]
push	ebp
push	esi
mov	esi, [esp+0Ch+arg_0]
test	ebx, ebx
mov	ebp, [esi+1Ch]
jnz	short loc_45E8C9
mov	eax, [esi+20h]
mov	ecx, [eax]
mov	dword ptr [ecx+14h], 28h
mov	eax, [esi+20h]
push	eax
mov	edx, [eax]
call	dword ptr [edx]
add	esp, 4

loc_45E8C9:				; CODE XREF: sub_45E8A0+10j
mov	eax, [esi+0Ch]
test	eax, eax
jnz	loc_45E971
push	edi
mov	eax, [esp+10h+arg_4]
mov	edi, 1
mov	ecx, ebx
shl	edi, cl
add	ebp, ebx
mov	ecx, 18h
sub	ecx, ebp
dec	edi
and	edi, eax
shl	edi, cl
mov	ecx, [esi+18h]
or	edi, ecx
cmp	ebp, 8
mov	[esp+10h+arg_0], edi
jl	short loc_45E96A
mov	eax, ebp
shr	eax, 3
mov	[esp+10h+arg_8], eax
neg	eax
lea	ebp, [ebp+eax*8+0]

loc_45E90D:				; CODE XREF: sub_45E8A0+C8j
mov	eax, [esi+10h]
xor	ebx, ebx
mov	bl, byte ptr [esp+10h+arg_0+2]
mov	[eax], bl
mov	ecx, [esi+10h]
mov	eax, [esi+14h]
inc	ecx
dec	eax
mov	[esi+10h], ecx
mov	[esi+14h], eax
jnz	short loc_45E931
push	esi
call	sub_45E980
add	esp, 4

loc_45E931:				; CODE XREF: sub_45E8A0+86j
cmp	ebx, 0FFh
jnz	short loc_45E958
mov	ecx, [esi+10h]
mov	byte ptr [ecx],	0
mov	ecx, [esi+10h]
mov	eax, [esi+14h]
inc	ecx
dec	eax
mov	[esi+10h], ecx
mov	[esi+14h], eax
jnz	short loc_45E958
push	esi
call	sub_45E980
add	esp, 4

loc_45E958:				; CODE XREF: sub_45E8A0+97j
					; sub_45E8A0+ADj
mov	eax, [esp+10h+arg_8]
shl	edi, 8
dec	eax
mov	[esp+10h+arg_0], edi
mov	[esp+10h+arg_8], eax
jnz	short loc_45E90D

loc_45E96A:				; CODE XREF: sub_45E8A0+5Cj
mov	[esi+18h], edi
mov	[esi+1Ch], ebp
pop	edi

loc_45E971:				; CODE XREF: sub_45E8A0+2Ej
pop	esi
pop	ebp
pop	ebx
retn
sub_45E8A0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45E980 proc	near			; CODE XREF: sub_45E8A0+89p
					; sub_45E8A0+B0p ...

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	edi
mov	eax, [esi+20h]
push	eax
mov	edi, [eax+18h]
call	dword ptr [edi+0Ch]
add	esp, 4
test	eax, eax
jnz	short loc_45E9AE
mov	eax, [esi+20h]
mov	ecx, [eax]
mov	dword ptr [ecx+14h], 18h
mov	eax, [esi+20h]
push	eax
mov	edx, [eax]
call	dword ptr [edx]
add	esp, 4

loc_45E9AE:				; CODE XREF: sub_45E980+15j
mov	eax, [edi]
mov	[esi+10h], eax
mov	ecx, [edi+4]
mov	[esi+14h], ecx
pop	edi
pop	esi
retn
sub_45E980 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45E9C0 proc	near			; CODE XREF: sub_45E740+D5p
					; sub_45EAE0+3Fp ...

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

mov	eax, [esp+arg_0]
mov	ecx, [eax+0Ch]
test	ecx, ecx
jz	short loc_45E9E1
mov	ecx, [esp+arg_4]
mov	edx, [eax+ecx*4+5Ch]
mov	eax, [esp+arg_8]
mov	ecx, [edx+eax*4]
lea	eax, [edx+eax*4]
inc	ecx
mov	[eax], ecx
retn
; ---------------------------------------------------------------------------

loc_45E9E1:				; CODE XREF: sub_45E9C0+9j
mov	ecx, [esp+arg_4]
mov	edx, [esp+arg_8]
push	esi
mov	ecx, [eax+ecx*4+4Ch]
movsx	esi, byte ptr [ecx+edx+400h]
mov	edx, [ecx+edx*4]
push	esi
push	edx
push	eax
call	sub_45E8A0
add	esp, 0Ch
pop	esi
retn
sub_45E9C0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45EA10 proc	near			; CODE XREF: sub_45E740+3Dp
					; sub_45EBA0+48p ...

arg_0= dword ptr  4
arg_4= byte ptr	 8

push	esi
mov	esi, [esp+4+arg_0]
push	esi
call	sub_45EAE0
mov	eax, [esi+0Ch]
add	esp, 4
test	eax, eax
jnz	short loc_45EA72
push	esi
call	sub_45EAC0
mov	eax, [esi+10h]
add	esp, 4
mov	byte ptr [eax],	0FFh
mov	ecx, [esi+10h]
mov	eax, [esi+14h]
inc	ecx
dec	eax
mov	[esi+10h], ecx
mov	[esi+14h], eax
jnz	short loc_45EA4D
push	esi
call	sub_45E980
add	esp, 4

loc_45EA4D:				; CODE XREF: sub_45EA10+32j
mov	cl, [esp+4+arg_4]
mov	edx, [esi+10h]
sub	cl, 30h
mov	[edx], cl
mov	ecx, [esi+10h]
mov	eax, [esi+14h]
inc	ecx
dec	eax
mov	[esi+10h], ecx
mov	[esi+14h], eax
jnz	short loc_45EA72
push	esi
call	sub_45E980
add	esp, 4

loc_45EA72:				; CODE XREF: sub_45EA10+13j
					; sub_45EA10+57j
mov	ecx, [esi+20h]
mov	eax, [ecx+13Ch]
test	eax, eax
jnz	short loc_45EAA5
mov	edx, [ecx+0F4h]
xor	eax, eax
test	edx, edx
jle	short loc_45EAB3
lea	ecx, [esi+24h]

loc_45EA8E:				; CODE XREF: sub_45EA10+91j
mov	dword ptr [ecx], 0
mov	edx, [esi+20h]
inc	eax
add	ecx, 4
cmp	eax, [edx+0F4h]
jl	short loc_45EA8E
pop	esi
retn
; ---------------------------------------------------------------------------

loc_45EAA5:				; CODE XREF: sub_45EA10+6Dj
mov	dword ptr [esi+38h], 0
mov	dword ptr [esi+3Ch], 0

loc_45EAB3:				; CODE XREF: sub_45EA10+79j
pop	esi
retn
sub_45EA10 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45EAC0 proc	near			; CODE XREF: sub_45EA10+16p
					; sub_45F070+24p

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	7
push	7Fh
push	esi
call	sub_45E8A0
add	esp, 0Ch
xor	eax, eax
mov	[esi+18h], eax
mov	[esi+1Ch], eax
pop	esi
retn
sub_45EAC0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45EAE0 proc	near			; CODE XREF: sub_45EA10+6p
					; sub_45EBA0+CCp ...

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
mov	eax, [esi+38h]
test	eax, eax
jbe	short loc_45EB59
push	edi
xor	edi, edi
sar	eax, 1
jz	short loc_45EB14

loc_45EAF3:				; CODE XREF: sub_45EAE0+16j
inc	edi
sar	eax, 1
jnz	short loc_45EAF3
cmp	edi, 0Eh
jle	short loc_45EB14
mov	eax, [esi+20h]
mov	ecx, [eax]
mov	dword ptr [ecx+14h], 28h
mov	eax, [esi+20h]
push	eax
mov	edx, [eax]
call	dword ptr [edx]
add	esp, 4

loc_45EB14:				; CODE XREF: sub_45EAE0+11j
					; sub_45EAE0+1Bj
mov	ecx, [esi+34h]
mov	eax, edi
shl	eax, 4
push	eax
push	ecx
push	esi
call	sub_45E9C0
add	esp, 0Ch
test	edi, edi
jz	short loc_45EB39
mov	edx, [esi+38h]
push	edi
push	edx
push	esi
call	sub_45E8A0
add	esp, 0Ch

loc_45EB39:				; CODE XREF: sub_45EAE0+49j
mov	eax, [esi+3Ch]
mov	ecx, [esi+40h]
push	eax
push	ecx
push	esi
mov	dword ptr [esi+38h], 0
call	sub_45EB60
add	esp, 0Ch
mov	dword ptr [esi+3Ch], 0
pop	edi

loc_45EB59:				; CODE XREF: sub_45EAE0+Aj
pop	esi
retn
sub_45EAE0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45EB60 proc	near			; CODE XREF: sub_45EAE0+69p
					; sub_45EE40+10Fp ...

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

push	ebx
mov	ebx, [esp+4+arg_0]
push	edi
mov	eax, [ebx+0Ch]
test	eax, eax
jnz	short loc_45EB8E
mov	edi, [esp+8+arg_8]
test	edi, edi
jbe	short loc_45EB8E
push	esi
mov	esi, [esp+0Ch+arg_4]

loc_45EB7A:				; CODE XREF: sub_45EB60+2Bj
movsx	eax, byte ptr [esi]
push	1
push	eax
push	ebx
call	sub_45E8A0
add	esp, 0Ch
inc	esi
dec	edi
jnz	short loc_45EB7A
pop	esi

loc_45EB8E:				; CODE XREF: sub_45EB60+Bj
					; sub_45EB60+13j
pop	edi
pop	ebx
retn
sub_45EB60 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45EBA0 proc	near			; DATA XREF: sub_45E5B0:loc_45E5F5o

var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8

sub	esp, 10h
push	ebx
mov	ebx, [esp+14h+arg_0]
push	ebp
push	esi
mov	eax, [ebx+18h]
mov	esi, [ebx+16Ch]
mov	ebp, [ebx+148h]
push	edi
mov	ecx, [eax]
mov	edi, [ebx+140h]
mov	[esi+10h], ecx
mov	edx, [ebx+18h]
mov	[esp+20h+var_8], ebp
mov	eax, [edx+4]
mov	[esi+14h], eax
mov	eax, [ebx+0C8h]
test	eax, eax
jz	short loc_45EBF0
mov	eax, [esi+44h]
test	eax, eax
jnz	short loc_45EBF0
mov	ecx, [esi+48h]
push	ecx
push	esi
call	sub_45EA10
add	esp, 8

loc_45EBF0:				; CODE XREF: sub_45EBA0+3Aj
					; sub_45EBA0+41j
mov	edx, [esp+20h+arg_4]
mov	eax, [edx]
xor	edx, edx
mov	[esp+20h+var_4], eax
mov	eax, [ebx+13Ch]
cmp	eax, edi
mov	[esp+20h+arg_4], edx
jg	loc_45ED36
sub	edi, eax
lea	ecx, dword_479024[eax*4]
inc	edi
mov	[esp+20h+var_10], ecx
mov	[esp+20h+var_C], edi
jmp	short loc_45EC26
; ---------------------------------------------------------------------------

loc_45EC22:				; CODE XREF: sub_45EBA0+173j
mov	ebp, [esp+20h+var_8]

loc_45EC26:				; CODE XREF: sub_45EBA0+80j
mov	eax, [esp+20h+var_10]
mov	ecx, [eax]
mov	eax, [esp+20h+var_4]
movsx	edi, word ptr [eax+ecx*2]
test	edi, edi
jnz	short loc_45EC42
inc	edx
mov	[esp+20h+arg_4], edx
jmp	loc_45ECFF
; ---------------------------------------------------------------------------

loc_45EC42:				; CODE XREF: sub_45EBA0+96j
jge	short loc_45EC50
neg	edi
mov	ecx, ebp
sar	edi, cl
mov	ebp, edi
not	ebp
jmp	short loc_45EC56
; ---------------------------------------------------------------------------

loc_45EC50:				; CODE XREF: sub_45EBA0:loc_45EC42j
mov	ecx, ebp
sar	edi, cl
mov	ebp, edi

loc_45EC56:				; CODE XREF: sub_45EBA0+AEj
test	edi, edi
jnz	short loc_45EC64
inc	edx
mov	[esp+20h+arg_4], edx
jmp	loc_45ECFF
; ---------------------------------------------------------------------------

loc_45EC64:				; CODE XREF: sub_45EBA0+B8j
mov	eax, [esi+38h]
test	eax, eax
jbe	short loc_45EC78
push	esi
call	sub_45EAE0
mov	edx, [esp+24h+arg_4]
add	esp, 4

loc_45EC78:				; CODE XREF: sub_45EBA0+C9j
cmp	edx, 0Fh
jle	short loc_45ECA8
mov	ebx, edx
mov	eax, [esp+20h+arg_4]
shr	ebx, 4
mov	ecx, ebx
neg	ecx
shl	ecx, 4
add	eax, ecx
mov	[esp+20h+arg_4], eax

loc_45EC93:				; CODE XREF: sub_45EBA0+106j
mov	edx, [esi+34h]
push	0F0h
push	edx
push	esi
call	sub_45E9C0
add	esp, 0Ch
dec	ebx
jnz	short loc_45EC93

loc_45ECA8:				; CODE XREF: sub_45EBA0+DBj
sar	edi, 1
mov	ebx, 1
jz	short loc_45ECD0

loc_45ECB1:				; CODE XREF: sub_45EBA0+114j
inc	ebx
sar	edi, 1
jnz	short loc_45ECB1
cmp	ebx, 0Ah
jle	short loc_45ECD0
mov	eax, [esp+20h+arg_0]
push	eax
mov	ecx, [eax]
mov	dword ptr [ecx+14h], 6
mov	edx, [eax]
call	dword ptr [edx]
add	esp, 4

loc_45ECD0:				; CODE XREF: sub_45EBA0+10Fj
					; sub_45EBA0+119j
mov	eax, [esp+20h+arg_4]
mov	ecx, [esi+34h]
shl	eax, 4
add	eax, ebx
push	eax
push	ecx
push	esi
call	sub_45E9C0
push	ebx
push	ebp
push	esi
call	sub_45E8A0
mov	ebx, [esp+38h+arg_0]
mov	[esp+38h+arg_4], 0
mov	edx, [esp+38h+arg_4]
add	esp, 18h

loc_45ECFF:				; CODE XREF: sub_45EBA0+9Dj
					; sub_45EBA0+BFj
mov	ecx, [esp+20h+var_10]
mov	eax, [esp+20h+var_C]
add	ecx, 4
dec	eax
mov	[esp+20h+var_10], ecx
mov	[esp+20h+var_C], eax
jnz	loc_45EC22
test	edx, edx
jle	short loc_45ED36
mov	ecx, [esi+38h]
inc	ecx
mov	eax, ecx
mov	[esi+38h], ecx
cmp	eax, 7FFFh
jnz	short loc_45ED36
push	esi
call	sub_45EAE0
add	esp, 4

loc_45ED36:				; CODE XREF: sub_45EBA0+68j
					; sub_45EBA0+17Bj ...
mov	edx, [ebx+18h]
mov	eax, [esi+10h]
mov	[edx], eax
mov	ecx, [ebx+18h]
mov	edx, [esi+14h]
mov	[ecx+4], edx
mov	eax, [ebx+0C8h]
test	eax, eax
jz	short loc_45ED68
mov	ecx, [esi+44h]
test	ecx, ecx
jnz	short loc_45ED65
mov	[esi+44h], eax
mov	eax, [esi+48h]
inc	eax
and	eax, 7
mov	[esi+48h], eax

loc_45ED65:				; CODE XREF: sub_45EBA0+1B6j
dec	dword ptr [esi+44h]

loc_45ED68:				; CODE XREF: sub_45EBA0+1AFj
pop	edi
pop	esi
pop	ebp
mov	eax, 1
pop	ebx
add	esp, 10h
retn
sub_45EBA0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45ED80 proc	near			; DATA XREF: sub_45E5B0+52o

arg_0= dword ptr  4
arg_4= dword ptr  8

push	esi
mov	esi, [esp+4+arg_0]
push	edi
mov	ecx, [esi+18h]
mov	edi, [esi+16Ch]
mov	eax, [esi+148h]
mov	edx, [ecx]
mov	[esp+8+arg_0], eax
mov	[edi+10h], edx
mov	eax, [esi+18h]
mov	ecx, [eax+4]
mov	[edi+14h], ecx
mov	eax, [esi+0C8h]
test	eax, eax
jz	short loc_45EDC5
mov	eax, [edi+44h]
test	eax, eax
jnz	short loc_45EDC5
mov	edx, [edi+48h]
push	edx
push	edi
call	sub_45EA10
add	esp, 8

loc_45EDC5:				; CODE XREF: sub_45ED80+2Fj
					; sub_45ED80+36j
mov	eax, [esi+110h]
push	ebx
xor	ebx, ebx
test	eax, eax
jle	short loc_45EE03
push	ebp
mov	ebp, [esp+10h+arg_4]

loc_45EDD7:				; CODE XREF: sub_45ED80+80j
mov	eax, [ebp+0]
mov	cx, word ptr [esp+10h+arg_0]
push	1
mov	dx, [eax]
sar	dx, cl
movsx	eax, dx
push	eax
push	edi
call	sub_45E8A0
mov	eax, [esi+110h]
add	esp, 0Ch
inc	ebx
add	ebp, 4
cmp	ebx, eax
jl	short loc_45EDD7
pop	ebp

loc_45EE03:				; CODE XREF: sub_45ED80+50j
mov	ecx, [esi+18h]
mov	edx, [edi+10h]
pop	ebx
mov	[ecx], edx
mov	eax, [esi+18h]
mov	ecx, [edi+14h]
mov	[eax+4], ecx
mov	esi, [esi+0C8h]
test	esi, esi
jz	short loc_45EE36
mov	eax, [edi+44h]
test	eax, eax
jnz	short loc_45EE33
mov	edx, [edi+48h]
mov	[edi+44h], esi
inc	edx
and	edx, 7
mov	[edi+48h], edx

loc_45EE33:				; CODE XREF: sub_45ED80+A4j
dec	dword ptr [edi+44h]

loc_45EE36:				; CODE XREF: sub_45ED80+9Dj
pop	edi
mov	eax, 1
pop	esi
retn
sub_45ED80 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45EE40 proc	near			; DATA XREF: sub_45E5B0+5Eo

var_114= dword ptr -114h
var_110= dword ptr -110h
var_10C= dword ptr -10Ch
var_108= dword ptr -108h
var_104= dword ptr -104h
var_100= dword ptr -100h
arg_0= dword ptr  4
arg_4= dword ptr  8

sub	esp, 114h
mov	edx, [esp+114h+arg_0]
push	ebx
push	ebp
push	esi
mov	eax, [edx+140h]
mov	ecx, [edx+18h]
mov	esi, [edx+16Ch]
mov	ebp, [edx+148h]
mov	[esp+120h+var_110], eax
mov	eax, [ecx]
mov	[esi+10h], eax
mov	ecx, [edx+18h]
push	edi
mov	eax, [ecx+4]
mov	[esi+14h], eax
mov	eax, [edx+0C8h]
test	eax, eax
jz	short loc_45EE9D
mov	eax, [esi+44h]
test	eax, eax
jnz	short loc_45EE9D
mov	ecx, [esi+48h]
push	ecx
push	esi
call	sub_45EA10
mov	edx, [esp+12Ch+arg_0]
add	esp, 8

loc_45EE9D:				; CODE XREF: sub_45EE40+40j
					; sub_45EE40+47j
mov	eax, [esp+124h+arg_4]
mov	edi, [edx+13Ch]
mov	[esp+124h+var_10C], 0
mov	ebx, [eax]
mov	eax, [esp+124h+var_110]
cmp	edi, eax
mov	[esp+124h+var_104], ebx
jg	short loc_45EEEB

loc_45EEC0:				; CODE XREF: sub_45EE40+A9j
mov	ecx, ds:dword_479024[edi*4]
movsx	eax, word ptr [ebx+ecx*2]
test	eax, eax
jge	short loc_45EED1
neg	eax

loc_45EED1:				; CODE XREF: sub_45EE40+8Dj
mov	ecx, ebp
sar	eax, cl
cmp	eax, 1
mov	[esp+edi*4+124h+var_100], eax
jnz	short loc_45EEE2
mov	[esp+124h+var_10C], edi

loc_45EEE2:				; CODE XREF: sub_45EE40+9Cj
mov	eax, [esp+124h+var_110]
inc	edi
cmp	edi, eax
jle	short loc_45EEC0

loc_45EEEB:				; CODE XREF: sub_45EE40+7Ej
mov	edi, [esi+40h]
mov	eax, [esi+3Ch]
mov	ecx, [esp+124h+var_110]
add	edi, eax
mov	eax, [edx+13Ch]
xor	ebx, ebx
xor	ebp, ebp
cmp	eax, ecx
mov	[esp+124h+var_114], eax
jg	loc_45F023

loc_45EF0D:				; CODE XREF: sub_45EE40+1A5j
mov	ecx, [esp+eax*4+124h+var_100]
test	ecx, ecx
mov	[esp+124h+var_108], ecx
jnz	short loc_45EF1F
inc	ebx
jmp	loc_45EFDA
; ---------------------------------------------------------------------------

loc_45EF1F:				; CODE XREF: sub_45EE40+D7j
cmp	ebx, 0Fh
jle	short loc_45EF79
jmp	short loc_45EF2E
; ---------------------------------------------------------------------------

loc_45EF26:				; CODE XREF: sub_45EE40+11Fj
mov	ecx, [esp+124h+var_108]
mov	eax, [esp+124h+var_114]

loc_45EF2E:				; CODE XREF: sub_45EE40+E4j
cmp	eax, [esp+124h+var_10C]
jg	short loc_45EF72
push	esi
call	sub_45EAE0
mov	edx, [esi+34h]
push	0F0h
push	edx
push	esi
call	sub_45E9C0
push	ebp
push	edi
push	esi
sub	ebx, 10h
call	sub_45EB60
mov	edi, [esi+40h]
add	esp, 1Ch
xor	ebp, ebp
cmp	ebx, 0Fh
jg	short loc_45EF26
mov	edx, [esp+124h+arg_0]
mov	ecx, [esp+124h+var_108]
mov	eax, [esp+124h+var_114]
jmp	short loc_45EF79
; ---------------------------------------------------------------------------

loc_45EF72:				; CODE XREF: sub_45EE40+F2j
mov	edx, [esp+124h+arg_0]

loc_45EF79:				; CODE XREF: sub_45EE40+E2j
					; sub_45EE40+130j
cmp	ecx, 1
jle	short loc_45EF87
and	cl, 1
mov	[edi+ebp], cl
inc	ebp
jmp	short loc_45EFDA
; ---------------------------------------------------------------------------

loc_45EF87:				; CODE XREF: sub_45EE40+13Cj
push	esi
call	sub_45EAE0
mov	eax, [esi+34h]
shl	ebx, 4
inc	ebx
push	ebx
push	eax
push	esi
call	sub_45E9C0
mov	ecx, [esp+134h+var_114]
xor	eax, eax
push	1
mov	edx, ds:dword_479024[ecx*4]
mov	ecx, [esp+138h+var_104]
cmp	[ecx+edx*2], ax
setnl	al
push	eax
push	esi
call	sub_45E8A0
push	ebp
push	edi
push	esi
call	sub_45EB60
mov	edi, [esi+40h]
mov	edx, [esp+14Ch+arg_0]
mov	eax, [esp+14Ch+var_114]
add	esp, 28h
xor	ebp, ebp
xor	ebx, ebx

loc_45EFDA:				; CODE XREF: sub_45EE40+DAj
					; sub_45EE40+145j
mov	ecx, [esp+124h+var_110]
inc	eax
cmp	eax, ecx
mov	[esp+124h+var_114], eax
jle	loc_45EF0D
test	ebx, ebx
jg	short loc_45EFF3
test	ebp, ebp
jbe	short loc_45F023

loc_45EFF3:				; CODE XREF: sub_45EE40+1ADj
mov	eax, [esi+38h]
mov	ebx, [esi+3Ch]
inc	eax
add	ebx, ebp
cmp	eax, 7FFFh
mov	[esi+38h], eax
mov	[esi+3Ch], ebx
mov	ecx, ebx
jz	short loc_45F013
cmp	ecx, 3A9h
jbe	short loc_45F023

loc_45F013:				; CODE XREF: sub_45EE40+1C9j
push	esi
call	sub_45EAE0
mov	edx, [esp+128h+arg_0]
add	esp, 4

loc_45F023:				; CODE XREF: sub_45EE40+C7j
					; sub_45EE40+1B1j ...
mov	eax, [edx+18h]
mov	ecx, [esi+10h]
mov	[eax], ecx
mov	eax, [edx+18h]
mov	ecx, [esi+14h]
mov	[eax+4], ecx
mov	edx, [edx+0C8h]
test	edx, edx
jz	short loc_45F055
mov	eax, [esi+44h]
test	eax, eax
jnz	short loc_45F052
mov	[esi+44h], edx
mov	edx, [esi+48h]
inc	edx
and	edx, 7
mov	[esi+48h], edx

loc_45F052:				; CODE XREF: sub_45EE40+203j
dec	dword ptr [esi+44h]

loc_45F055:				; CODE XREF: sub_45EE40+1FCj
pop	edi
pop	esi
pop	ebp
mov	eax, 1
pop	ebx
add	esp, 114h
retn
sub_45EE40 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45F070 proc	near			; DATA XREF: sub_45E5B0:loc_45E639o

arg_0= dword ptr  4

push	esi
push	edi
mov	edi, [esp+8+arg_0]
mov	eax, [edi+18h]
mov	esi, [edi+16Ch]
push	esi
mov	ecx, [eax]
mov	[esi+10h], ecx
mov	edx, [edi+18h]
mov	eax, [edx+4]
mov	[esi+14h], eax
call	sub_45EAE0
push	esi
call	sub_45EAC0
mov	ecx, [edi+18h]
mov	edx, [esi+10h]
add	esp, 8
mov	[ecx], edx
mov	eax, [edi+18h]
mov	ecx, [esi+14h]
pop	edi
mov	[eax+4], ecx
pop	esi
retn
sub_45F070 endp


; =============== S U B	R O U T	I N E =======================================


sub_45F0B0 proc	near			; DATA XREF: sub_45E5B0+80o

var_1C=	dword ptr -1Ch
var_18=	dword ptr -18h
var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4

sub	esp, 1Ch
push	esi
mov	esi, [esp+20h+arg_0]
mov	eax, [esi+16Ch]
push	eax
mov	[esp+24h+var_18], eax
call	sub_45EAE0
mov	edx, [esi+13Ch]
add	esp, 4
xor	ecx, ecx
test	edx, edx
setz	cl
xor	eax, eax
mov	[esp+20h+var_14], ecx
mov	[esp+20h+var_10], eax
mov	[esp+20h+var_C], eax
mov	[esp+20h+var_8], eax
mov	[esp+20h+var_4], eax
mov	[esp+20h+var_1C], eax
mov	eax, [esi+0F4h]
test	eax, eax
jle	loc_45F196
push	ebx
lea	edx, [esi+0F8h]
push	ebp
push	edi
mov	[esp+2Ch+arg_0], edx

loc_45F10D:				; CODE XREF: sub_45F0B0+DDj
mov	eax, [esp+2Ch+arg_0]
test	ecx, ecx
mov	eax, [eax]
jz	short loc_45F126
mov	edx, [esi+144h]
test	edx, edx
jnz	short loc_45F171
mov	ebx, [eax+14h]
jmp	short loc_45F129
; ---------------------------------------------------------------------------

loc_45F126:				; CODE XREF: sub_45F0B0+65j
mov	ebx, [eax+18h]

loc_45F129:				; CODE XREF: sub_45F0B0+74j
mov	eax, [esp+ebx*4+2Ch+var_10]
lea	ebp, [esp+ebx*4+2Ch+var_10]
test	eax, eax
jnz	short loc_45F171
test	ecx, ecx
lea	edi, [esi+ebx*4+58h]
jnz	short loc_45F141
lea	edi, [esi+ebx*4+68h]

loc_45F141:				; CODE XREF: sub_45F0B0+8Bj
cmp	dword ptr [edi], 0
jnz	short loc_45F151
push	esi
call	sub_459670
add	esp, 4
mov	[edi], eax

loc_45F151:				; CODE XREF: sub_45F0B0+94j
mov	ecx, [esp+2Ch+var_18]
mov	eax, [edi]
mov	edx, [ecx+ebx*4+5Ch]
push	edx
push	eax
push	esi
call	sub_45D9B0
mov	ecx, [esp+38h+var_14]
add	esp, 0Ch
mov	dword ptr [ebp+0], 1

loc_45F171:				; CODE XREF: sub_45F0B0+6Fj
					; sub_45F0B0+83j
mov	eax, [esp+2Ch+var_1C]
mov	edi, [esp+2Ch+arg_0]
mov	edx, [esi+0F4h]
inc	eax
add	edi, 4
cmp	eax, edx
mov	[esp+2Ch+var_1C], eax
mov	[esp+2Ch+arg_0], edi
jl	loc_45F10D
pop	edi
pop	ebp
pop	ebx

loc_45F196:				; CODE XREF: sub_45F0B0+4Aj
pop	esi
add	esp, 1Ch
retn
sub_45F0B0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45F1A0 proc	near			; CODE XREF: sub_459F80+32p

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
push	edi
push	30h
mov	eax, [esi+4]
push	1
push	esi
call	dword ptr [eax]
mov	edi, eax
add	esp, 0Ch
mov	[esi+168h], edi
mov	dword ptr [edi], offset	sub_45F240
mov	eax, [esi+0C4h]
sub	eax, 0
jz	short loc_45F205
dec	eax
jz	short loc_45F1F5
dec	eax
jz	short loc_45F1E5
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 30h
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4
jmp	short loc_45F213
; ---------------------------------------------------------------------------

loc_45F1E5:				; CODE XREF: sub_45F1A0+30j
mov	dword ptr [edi+4], offset sub_45F5B0
mov	dword ptr [edi+1Ch], offset loc_468AD0
jmp	short loc_45F213
; ---------------------------------------------------------------------------

loc_45F1F5:				; CODE XREF: sub_45F1A0+2Dj
mov	dword ptr [edi+4], offset sub_45F410
mov	dword ptr [edi+8], offset sub_468880
jmp	short loc_45F213
; ---------------------------------------------------------------------------

loc_45F205:				; CODE XREF: sub_45F1A0+2Aj
mov	dword ptr [edi+4], offset sub_45F410
mov	dword ptr [edi+8], offset sub_468480

loc_45F213:				; CODE XREF: sub_45F1A0+43j
					; sub_45F1A0+53j ...
lea	eax, [edi+20h]
pop	edi
mov	ecx, 4
pop	esi

loc_45F21D:				; CODE XREF: sub_45F1A0+8Ej
mov	dword ptr [eax-14h], 0
mov	dword ptr [eax], 0
add	eax, 4
dec	ecx
jnz	short loc_45F21D
retn

align 4
loc_468AD0:				; DATA XREF: sub_45F1A0+4Co
mov	edx, [esp+4]
sub	esp, 18h
mov	ecx, 8
lea	eax, [edx+8]

loc_468ADF:				; CODE XREF: .text:00468BF4j
fld	dword ptr [eax+14h]
fadd	dword ptr [eax-8]
fld	dword ptr [eax-8]
fsub	dword ptr [eax+14h]
fstp	dword ptr [esp+1Ch]
fld	dword ptr [eax+10h]
fadd	dword ptr [eax-4]
fstp	dword ptr [esp+4]
fld	dword ptr [eax-4]
fsub	dword ptr [eax+10h]
fstp	dword ptr [esp+10h]
fld	dword ptr [eax]
fadd	dword ptr [eax+0Ch]
fstp	dword ptr [esp+8]
fld	dword ptr [eax]
fsub	dword ptr [eax+0Ch]
fstp	dword ptr [esp+0Ch]
fld	dword ptr [eax+8]
fadd	dword ptr [eax+4]
fld	dword ptr [eax+4]
fsub	dword ptr [eax+8]
fstp	dword ptr [esp+14h]
fld	st
fadd	st, st(2)
fstp	dword ptr [esp+0]
fxch	st(1)
fsub	st, st(1)
fxch	st(1)
fstp	st
fld	dword ptr [esp+8]
fadd	dword ptr [esp+4]
fld	st
fadd	dword ptr [esp+0]
fstp	dword ptr [eax-8]
fld	dword ptr [esp+0]
fsub	st, st(1)
fstp	dword ptr [eax+8]
fstp	st
fld	dword ptr [esp+4]
fsub	dword ptr [esp+8]
fadd	st, st(1)
fmul	dword ptr flt_479510
fld	st
fadd	st, st(2)
fstp	dword ptr [eax]
fxch	st(1)
fsub	st, st(1)
fstp	dword ptr [eax+10h]
fstp	st
fld	dword ptr [esp+14h]
fadd	dword ptr [esp+0Ch]
fld	dword ptr [esp+10h]
fadd	dword ptr [esp+1Ch]
fstp	dword ptr [esp+8]
fld	st
fsub	dword ptr [esp+8]
fmul	dword ptr flt_47950C
fstp	dword ptr [esp+4]
fmul	dword ptr flt_479508
fadd	dword ptr [esp+4]
fld	dword ptr [esp+8]
fmul	dword ptr flt_479504
fadd	dword ptr [esp+4]
fstp	dword ptr [esp+8]
fld	dword ptr [esp+0Ch]
fadd	dword ptr [esp+10h]
fmul	dword ptr flt_479510
fld	st
fadd	dword ptr [esp+1Ch]
fstp	dword ptr [esp+10h]
fsubr	dword ptr [esp+1Ch]
fld	st
fadd	st, st(2)
fstp	dword ptr [eax+0Ch]
fsub	st, st(1)
fstp	dword ptr [eax+4]
fstp	st
fld	dword ptr [esp+10h]
fadd	dword ptr [esp+8]
add	eax, 20h
dec	ecx
fstp	dword ptr [eax-24h]
fld	dword ptr [esp+10h]
fsub	dword ptr [esp+8]
fstp	dword ptr [eax-0Ch]
jnz	loc_468ADF
lea	eax, [edx+40h]
mov	ecx, 8

loc_468C02:				; CODE XREF: .text:00468D29j
fld	dword ptr [eax-40h]
fadd	dword ptr [eax+0A0h]
fld	dword ptr [eax-40h]
fsub	dword ptr [eax+0A0h]
fstp	dword ptr [esp+1Ch]
fld	dword ptr [eax-20h]
fadd	dword ptr [eax+80h]
fstp	dword ptr [esp+4]
fld	dword ptr [eax-20h]
fsub	dword ptr [eax+80h]
fstp	dword ptr [esp+10h]
fld	dword ptr [eax]
fadd	dword ptr [eax+60h]
fstp	dword ptr [esp+8]
fld	dword ptr [eax]
fsub	dword ptr [eax+60h]
fstp	dword ptr [esp+0Ch]
fld	dword ptr [eax+40h]
fadd	dword ptr [eax+20h]
fld	dword ptr [eax+20h]
fsub	dword ptr [eax+40h]
fstp	dword ptr [esp+14h]
fld	st
fadd	st, st(2)
fstp	dword ptr [esp+0]
fxch	st(1)
fsub	st, st(1)
fxch	st(1)
fstp	st
fld	dword ptr [esp+8]
fadd	dword ptr [esp+4]
fld	st
fadd	dword ptr [esp+0]
fstp	dword ptr [eax-40h]
fld	dword ptr [esp+0]
fsub	st, st(1)
fstp	dword ptr [eax+40h]
fstp	st
fld	dword ptr [esp+4]
fsub	dword ptr [esp+8]
fadd	st, st(1)
fmul	dword ptr flt_479510
fld	st
fadd	st, st(2)
fstp	dword ptr [eax]
fxch	st(1)
fsub	st, st(1)
fstp	dword ptr [eax+80h]
fstp	st
fld	dword ptr [esp+14h]
fadd	dword ptr [esp+0Ch]
fld	dword ptr [esp+10h]
fadd	dword ptr [esp+1Ch]
fstp	dword ptr [esp+8]
fld	st
fsub	dword ptr [esp+8]
fmul	dword ptr flt_47950C
fstp	dword ptr [esp+4]
fmul	dword ptr flt_479508
fadd	dword ptr [esp+4]
fld	dword ptr [esp+8]
fmul	dword ptr flt_479504
fadd	dword ptr [esp+4]
fstp	dword ptr [esp+8]
fld	dword ptr [esp+0Ch]
fadd	dword ptr [esp+10h]
fmul	dword ptr flt_479510
fld	st
fadd	dword ptr [esp+1Ch]
fstp	dword ptr [esp+10h]
fsubr	dword ptr [esp+1Ch]
fld	st
fadd	st, st(2)
fstp	dword ptr [eax+60h]
fsub	st, st(1)
fstp	dword ptr [eax+20h]
fstp	st
fld	dword ptr [esp+10h]
fadd	dword ptr [esp+8]
add	eax, 4
dec	ecx
fstp	dword ptr [eax-24h]
fld	dword ptr [esp+10h]
fsub	dword ptr [esp+8]
fstp	dword ptr [eax+9Ch]
jnz	loc_468C02
add	esp, 18h
retn
sub_45F1A0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45F240 proc	near			; DATA XREF: sub_45F1A0+1Bo

var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4

sub	esp, 10h
push	ebp
push	edi
mov	edi, [esp+18h+arg_0]
mov	[esp+18h+var_C], 0
mov	ecx, [edi+3Ch]
mov	ebp, [edi+168h]
mov	eax, [edi+44h]
mov	[esp+18h+var_4], ebp
test	ecx, ecx
jle	loc_45F3FD
add	eax, 10h
push	ebx
push	esi
mov	[esp+20h+var_10], eax

loc_45F272:				; CODE XREF: sub_45F240+1B5j
mov	eax, [esp+20h+var_10]
mov	esi, [eax]
test	esi, esi
jl	short loc_45F289
cmp	esi, 4
jge	short loc_45F289
mov	eax, [edi+esi*4+48h]
test	eax, eax
jnz	short loc_45F29F

loc_45F289:				; CODE XREF: sub_45F240+3Aj
					; sub_45F240+3Fj
mov	ecx, [edi]
push	edi
mov	dword ptr [ecx+14h], 34h
mov	edx, [edi]
mov	[edx+18h], esi
mov	eax, [edi]
call	dword ptr [eax]
add	esp, 4

loc_45F29F:				; CODE XREF: sub_45F240+47j
mov	eax, [edi+0C4h]
mov	ebx, [edi+esi*4+48h]
sub	eax, 0
jz	loc_45F3A1
dec	eax
jz	loc_45F351
dec	eax
jz	short loc_45F2D2
mov	ecx, [edi]
push	edi
mov	dword ptr [ecx+14h], 30h
mov	edx, [edi]
call	dword ptr [edx]
add	esp, 4
jmp	loc_45F3DC
; ---------------------------------------------------------------------------

loc_45F2D2:				; CODE XREF: sub_45F240+7Aj
mov	eax, [ebp+esi*4+20h]
test	eax, eax
jnz	short loc_45F2EE
mov	eax, [edi+4]
push	100h
push	1
push	edi
call	dword ptr [eax]
add	esp, 0Ch
mov	[ebp+esi*4+20h], eax

loc_45F2EE:				; CODE XREF: sub_45F240+98j
mov	esi, [ebp+esi*4+20h]
mov	edi, esi
mov	esi, (offset dword_479024+1C4h)

loc_45F2F9:				; CODE XREF: sub_45F240+102j
mov	edx, edi
mov	ecx, ebx
add	edi, 20h
mov	eax, (offset dword_479024+1C4h)
add	ebx, 10h

loc_45F308:				; CODE XREF: sub_45F240+F7j
xor	ebp, ebp
add	eax, 8
mov	bp, [ecx]
add	ecx, 2
mov	[esp+20h+var_8], ebp
add	edx, 4
fild	[esp+20h+var_8]
cmp	eax, offset dbl_479228
fmul	qword ptr [eax-8]
fmul	qword ptr [esi]
fmul	ds:dbl_479228
fdivr	ds:dbl_478A08
fstp	dword ptr [edx-4]
jl	short loc_45F308
add	esi, 8
cmp	esi, offset dbl_479228
jl	short loc_45F2F9
mov	ebp, [esp+20h+var_4]
mov	edi, [esp+20h+arg_0]
jmp	loc_45F3DC
; ---------------------------------------------------------------------------

loc_45F351:				; CODE XREF: sub_45F240+73j
mov	eax, [ebp+esi*4+0Ch]
test	eax, eax
jnz	short loc_45F36D
mov	ecx, [edi+4]
push	100h
push	1
push	edi
call	dword ptr [ecx]
add	esp, 0Ch
mov	[ebp+esi*4+0Ch], eax

loc_45F36D:				; CODE XREF: sub_45F240+117j
mov	esi, [ebp+esi*4+0Ch]
mov	eax, (offset dword_479024+144h)
mov	ecx, ebx
sub	ecx, eax

loc_45F37A:				; CODE XREF: sub_45F240+15Dj
movsx	ebx, word ptr [eax]
xor	edx, edx
add	esi, 4
mov	dx, [ecx+eax]
add	eax, 2
imul	edx, ebx
add	edx, 400h
sar	edx, 0Bh
mov	[esi-4], edx
cmp	eax, (offset dword_479024+1C4h)
jl	short loc_45F37A
jmp	short loc_45F3DC
; ---------------------------------------------------------------------------

loc_45F3A1:				; CODE XREF: sub_45F240+6Cj
mov	eax, [ebp+esi*4+0Ch]
test	eax, eax
jnz	short loc_45F3BD
mov	eax, [edi+4]
push	100h
push	1
push	edi
call	dword ptr [eax]
add	esp, 0Ch
mov	[ebp+esi*4+0Ch], eax

loc_45F3BD:				; CODE XREF: sub_45F240+167j
mov	esi, [ebp+esi*4+0Ch]
mov	eax, ebx
mov	ecx, 40h

loc_45F3C8:				; CODE XREF: sub_45F240+19Aj
xor	edx, edx
add	esi, 4
mov	dx, [eax]
add	eax, 2
shl	edx, 3
mov	[esi-4], edx
dec	ecx
jnz	short loc_45F3C8

loc_45F3DC:				; CODE XREF: sub_45F240+8Dj
					; sub_45F240+10Cj ...
mov	eax, [esp+20h+var_C]
mov	edx, [esp+20h+var_10]
mov	ecx, [edi+3Ch]
inc	eax
add	edx, 54h
cmp	eax, ecx
mov	[esp+20h+var_C], eax
mov	[esp+20h+var_10], edx
jl	loc_45F272
pop	esi
pop	ebx

loc_45F3FD:				; CODE XREF: sub_45F240+23j
pop	edi
pop	ebp
add	esp, 10h
retn
sub_45F240 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45F410 proc	near			; DATA XREF: sub_45F1A0:loc_45F1F5o
					; sub_45F1A0:loc_45F205o

var_10C= dword ptr -10Ch
var_108= dword ptr -108h
var_104= dword ptr -104h
var_100= byte ptr -100h
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h
arg_14=	dword ptr  18h
arg_18=	dword ptr  1Ch

sub	esp, 10Ch
mov	eax, [esp+10Ch+arg_0]
mov	edx, [esp+10Ch+arg_4]
mov	eax, [eax+168h]
mov	ecx, [eax+8]
mov	[esp+10Ch+var_108], ecx
mov	ecx, [edx+10h]
mov	edx, [eax+ecx*4+0Ch]
mov	eax, [esp+10Ch+arg_10]
mov	ecx, [esp+10Ch+arg_8]
mov	[esp+10Ch+var_104], edx
lea	edx, [ecx+eax*4]
mov	eax, [esp+10Ch+arg_18]
test	eax, eax
mov	[esp+10Ch+arg_8], edx
jbe	loc_45F5A2
push	ebx
push	ebp
mov	ebp, [esp+114h+arg_C]
push	esi
push	edi
mov	[esp+11Ch+var_10C], eax

loc_45F472:				; CODE XREF: sub_45F410+188j
mov	esi, [esp+11Ch+arg_8]
lea	ecx, [esp+11Ch+var_100]
mov	edi, 8

loc_45F482:				; CODE XREF: sub_45F410+108j
mov	eax, [esi]
mov	edx, [esp+11Ch+arg_14]
add	eax, edx
xor	edx, edx
add	ecx, 4
add	esi, 4
mov	dl, [eax]
add	ecx, 4
sub	edx, 80h
inc	eax
mov	[ecx-8], edx
xor	edx, edx
mov	dl, [eax]
add	ecx, 4
sub	edx, 80h
inc	eax
mov	[ecx-8], edx
xor	edx, edx
mov	dl, [eax]
add	ecx, 4
sub	edx, 80h
inc	eax
mov	[ecx-8], edx
xor	edx, edx
mov	dl, [eax]
add	ecx, 4
sub	edx, 80h
inc	eax
mov	[ecx-8], edx
xor	edx, edx
mov	dl, [eax]
add	ecx, 4
sub	edx, 80h
inc	eax
mov	[ecx-8], edx
xor	edx, edx
mov	dl, [eax]
add	ecx, 4
sub	edx, 80h
inc	eax
mov	[ecx-8], edx
xor	edx, edx
mov	dl, [eax]
add	ecx, 4
sub	edx, 80h
mov	[ecx-8], edx
xor	edx, edx
mov	dl, [eax+1]
sub	edx, 80h
dec	edi
mov	[ecx-4], edx
jnz	loc_45F482
lea	eax, [esp+11Ch+var_100]
push	eax
call	[esp+120h+var_108]
mov	edi, ebp
mov	ebp, [esp+120h+var_104]
lea	ecx, [esp+120h+var_100]
add	esp, 4
lea	esi, [esp+11Ch+var_100]
sub	ebp, ecx
mov	ebx, 40h

loc_45F53F:				; CODE XREF: sub_45F410+16Aj
mov	eax, [esi]
mov	ecx, [esi+ebp]
test	eax, eax
mov	edx, ecx
jge	short loc_45F561
sar	edx, 1
sub	edx, eax
cmp	edx, ecx
jl	short loc_45F55B
mov	eax, edx
cdq
idiv	ecx
neg	eax
jmp	short loc_45F570
; ---------------------------------------------------------------------------

loc_45F55B:				; CODE XREF: sub_45F410+140j
xor	eax, eax
neg	eax
jmp	short loc_45F570
; ---------------------------------------------------------------------------

loc_45F561:				; CODE XREF: sub_45F410+138j
sar	edx, 1
add	eax, edx
cmp	eax, ecx
jl	short loc_45F56E
cdq
idiv	ecx
jmp	short loc_45F570
; ---------------------------------------------------------------------------

loc_45F56E:				; CODE XREF: sub_45F410+157j
xor	eax, eax

loc_45F570:				; CODE XREF: sub_45F410+149j
					; sub_45F410+14Fj ...
mov	[edi], ax
add	esi, 4
add	edi, 2
dec	ebx
jnz	short loc_45F53F
mov	ecx, [esp+11Ch+arg_14]
mov	eax, [esp+11Ch+var_10C]
add	ecx, 8
dec	eax
mov	ebp, edi
mov	[esp+11Ch+arg_14], ecx
mov	[esp+11Ch+var_10C], eax
jnz	loc_45F472
pop	edi
pop	esi
pop	ebp
pop	ebx

loc_45F5A2:				; CODE XREF: sub_45F410+4Dj
add	esp, 10Ch
retn
sub_45F410 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45F5B0 proc	near			; DATA XREF: sub_45F1A0:loc_45F1E5o

var_110= dword ptr -110h
var_10C= dword ptr -10Ch
var_108= dword ptr -108h
var_104= dword ptr -104h
var_100= byte ptr -100h
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h
arg_14=	dword ptr  18h
arg_18=	dword ptr  1Ch

sub	esp, 110h
mov	eax, [esp+110h+arg_0]
mov	edx, [esp+110h+arg_4]
mov	eax, [eax+168h]
mov	ecx, [eax+1Ch]
mov	[esp+110h+var_108], ecx
mov	ecx, [edx+10h]
mov	edx, [eax+ecx*4+20h]
mov	eax, [esp+110h+arg_10]
mov	ecx, [esp+110h+arg_8]
mov	[esp+110h+var_104], edx
lea	edx, [ecx+eax*4]
mov	eax, [esp+110h+arg_18]
test	eax, eax
mov	[esp+110h+arg_8], edx
jbe	loc_45F762
push	ebx
push	ebp
push	esi
push	edi
mov	edi, [esp+120h+arg_C]
mov	[esp+120h+var_10C], eax

loc_45F612:				; CODE XREF: sub_45F5B0+1A8j
mov	esi, [esp+120h+arg_8]
lea	ecx, [esp+120h+var_100]
mov	ebp, 8

loc_45F622:				; CODE XREF: sub_45F5B0+148j
mov	eax, [esp+120h+arg_14]
mov	edx, [esi]
add	eax, edx
xor	edx, edx
add	ecx, 4
add	esi, 4
mov	dl, [eax]
add	ecx, 4
sub	edx, 80h
inc	eax
mov	[esp+120h+var_110], edx
xor	edx, edx
fild	[esp+120h+var_110]
add	ecx, 4
fstp	dword ptr [ecx-0Ch]
mov	dl, [eax]
add	ecx, 4
sub	edx, 80h
inc	eax
mov	[esp+120h+var_110], edx
xor	edx, edx
fild	[esp+120h+var_110]
add	ecx, 4
fstp	dword ptr [ecx-10h]
mov	dl, [eax]
add	ecx, 4
sub	edx, 80h
inc	eax
mov	[esp+120h+var_110], edx
xor	edx, edx
fild	[esp+120h+var_110]
add	ecx, 4
fstp	dword ptr [ecx-14h]
mov	dl, [eax]
add	ecx, 4
sub	edx, 80h
inc	eax
mov	[esp+120h+var_110], edx
xor	edx, edx
fild	[esp+120h+var_110]
fstp	dword ptr [ecx-14h]
mov	dl, [eax]
sub	edx, 80h
inc	eax
mov	[esp+120h+var_110], edx
xor	edx, edx
fild	[esp+120h+var_110]
fstp	dword ptr [ecx-10h]
mov	dl, [eax]
sub	edx, 80h
inc	eax
mov	[esp+120h+var_110], edx
xor	edx, edx
fild	[esp+120h+var_110]
fstp	dword ptr [ecx-0Ch]
mov	dl, [eax]
sub	edx, 80h
mov	[esp+120h+var_110], edx
xor	edx, edx
fild	[esp+120h+var_110]
fstp	dword ptr [ecx-8]
mov	dl, [eax+1]
sub	edx, 80h
dec	ebp
mov	[esp+120h+var_110], edx
fild	[esp+120h+var_110]
fstp	dword ptr [ecx-4]
jnz	loc_45F622
lea	eax, [esp+120h+var_100]
push	eax
call	[esp+124h+var_108]
mov	ebx, [esp+124h+var_104]
lea	ecx, [esp+124h+var_100]
add	esp, 4
lea	esi, [esp+120h+var_100]
sub	ebx, ecx
mov	ebp, 40h

loc_45F71D:				; CODE XREF: sub_45F5B0+18Cj
fld	dword ptr [ebx+esi]
fmul	dword ptr [esi]
fadd	dword ptr flt_479230
call	__ftol
sub	eax, 4000h
add	esi, 4
mov	[edi], ax
add	edi, 2
dec	ebp
jnz	short loc_45F71D
mov	ecx, [esp+120h+arg_14]
mov	eax, [esp+120h+var_10C]
add	ecx, 8
dec	eax
mov	[esp+120h+arg_14], ecx
mov	[esp+120h+var_10C], eax
jnz	loc_45F612
pop	edi
pop	esi
pop	ebp
pop	ebx

loc_45F762:				; CODE XREF: sub_45F5B0+4Dj
add	esp, 110h
retn
sub_45F5B0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45F770 proc	near			; CODE XREF: sub_459F80+29p

arg_0= dword ptr  4
arg_4= dword ptr  8

mov	eax, [esp+arg_4]
push	ebp
push	esi
mov	esi, [esp+8+arg_0]
test	eax, eax
jz	short loc_45F78F
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 4
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4

loc_45F78F:				; CODE XREF: sub_45F770+Cj
mov	edx, [esi+4]
push	40h
push	1
push	esi
call	dword ptr [edx]
mov	[esi+154h], eax
mov	dword ptr [eax], offset	sub_45F820
mov	ecx, [esi+164h]
add	esp, 0Ch
mov	edx, [ecx+8]
test	edx, edx
jz	short loc_45F7C8
push	esi
mov	dword ptr [eax+4], offset sub_45FA30
call	sub_45FC00
add	esp, 4
pop	esi
pop	ebp
retn
; ---------------------------------------------------------------------------

loc_45F7C8:				; CODE XREF: sub_45F770+43j
mov	dword ptr [eax+4], offset sub_45F870
mov	edx, [esi+3Ch]
mov	ecx, [esi+44h]
xor	ebp, ebp
test	edx, edx
jle	short loc_45F819
push	ebx
push	edi
lea	edi, [ecx+8]
lea	ebx, [eax+8]

loc_45F7E3:				; CODE XREF: sub_45F770+A5j
mov	eax, [edi+14h]
mov	edx, [esi+0ECh]
imul	eax, [esi+0E8h]
shl	eax, 3
push	edx
mov	ecx, [esi+4]
cdq
idiv	dword ptr [edi]
push	eax
push	1
push	esi
call	dword ptr [ecx+8]
add	esp, 10h
mov	[ebx], eax
mov	eax, [esi+3Ch]
inc	ebp
add	ebx, 4
add	edi, 54h
cmp	ebp, eax
jl	short loc_45F7E3
pop	edi
pop	ebx

loc_45F819:				; CODE XREF: sub_45F770+69j
pop	esi
pop	ebp
retn
sub_45F770 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45F820 proc	near			; DATA XREF: sub_45F770+2Fo

arg_0= dword ptr  4
arg_4= dword ptr  8

mov	eax, [esp+arg_4]
push	esi
push	edi
mov	edi, [esp+8+arg_0]
test	eax, eax
mov	esi, [edi+154h]
jz	short loc_45F845
mov	eax, [edi]
push	edi
mov	dword ptr [eax+14h], 4
mov	ecx, [edi]
call	dword ptr [ecx]
add	esp, 4

loc_45F845:				; CODE XREF: sub_45F820+12j
mov	edx, [edi+20h]
mov	dword ptr [esi+34h], 0
mov	[esi+30h], edx
mov	dword ptr [esi+38h], 0
mov	eax, [edi+0ECh]
pop	edi
shl	eax, 1
mov	[esi+3Ch], eax
pop	esi
retn
sub_45F820 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45F870 proc	near			; DATA XREF: sub_45F770:loc_45F7C8o

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h
arg_14=	dword ptr  18h
arg_18=	dword ptr  1Ch

mov	eax, [esp+arg_8]
push	ebx
push	ebp
push	esi
mov	ecx, [eax]
mov	esi, [esp+0Ch+arg_0]
mov	eax, [esp+0Ch+arg_C]
push	edi
mov	edi, [esi+154h]
cmp	ecx, eax
jnb	loc_45F9E8

loc_45F890:				; CODE XREF: sub_45F870+11Ej
mov	eax, [esp+10h+arg_14]
mov	edx, [esp+10h+arg_18]
cmp	[eax], edx
jnb	loc_45F9E8
mov	eax, [esp+10h+arg_C]
mov	ebx, [esi+0ECh]
mov	ebp, [edi+34h]
sub	eax, ecx
sub	ebx, ebp
cmp	ebx, eax
jb	short loc_45F8B7
mov	ebx, eax

loc_45F8B7:				; CODE XREF: sub_45F870+43j
mov	eax, [edi+34h]
mov	edx, [esi+160h]
push	ebx
push	eax
mov	eax, [esp+18h+arg_4]
lea	ebp, [edi+8]
push	ebp
lea	ecx, [eax+ecx*4]
push	ecx
push	esi
call	dword ptr [edx+4]
mov	eax, [esp+24h+arg_8]
add	esp, 14h
mov	ecx, [eax]
add	ecx, ebx
mov	[eax], ecx
mov	edx, [edi+34h]
mov	ecx, [edi+30h]
add	edx, ebx
sub	ecx, ebx
mov	[edi+34h], edx
mov	eax, edx
mov	[edi+30h], ecx
jnz	short loc_45F933
cmp	eax, [esi+0ECh]
jge	short loc_45F933
mov	eax, [esi+3Ch]
xor	ebx, ebx
test	eax, eax
jle	short loc_45F92A

loc_45F904:				; CODE XREF: sub_45F870+B8j
mov	edx, [esi+0ECh]
mov	eax, [edi+34h]
mov	ecx, [esi+1Ch]
push	edx
mov	edx, [ebp+0]
push	eax
push	ecx
push	edx
call	sub_45F9F0
mov	eax, [esi+3Ch]
add	esp, 10h
inc	ebx
add	ebp, 4
cmp	ebx, eax
jl	short loc_45F904

loc_45F92A:				; CODE XREF: sub_45F870+92j
mov	eax, [esi+0ECh]
mov	[edi+34h], eax

loc_45F933:				; CODE XREF: sub_45F870+81j
					; sub_45F870+89j
mov	ecx, [edi+34h]
mov	eax, [esi+0ECh]
cmp	ecx, eax
jnz	short loc_45F96D
mov	ebx, [esp+10h+arg_14]
mov	ecx, [esp+10h+arg_10]
mov	edx, [esi+164h]
mov	eax, [ebx]
push	eax
push	ecx
lea	eax, [edi+8]
push	0
push	eax
push	esi
call	dword ptr [edx+4]
mov	dword ptr [edi+34h], 0
mov	eax, [ebx]
add	esp, 14h
inc	eax
mov	[ebx], eax
jmp	short loc_45F971
; ---------------------------------------------------------------------------

loc_45F96D:				; CODE XREF: sub_45F870+CEj
mov	ebx, [esp+10h+arg_14]

loc_45F971:				; CODE XREF: sub_45F870+FBj
mov	eax, [edi+30h]
test	eax, eax
jnz	short loc_45F982
mov	edx, [esp+10h+arg_18]
mov	eax, [ebx]
cmp	eax, edx
jb	short loc_45F999

loc_45F982:				; CODE XREF: sub_45F870+106j
mov	eax, [esp+10h+arg_8]
mov	ecx, [eax]
mov	eax, [esp+10h+arg_C]
cmp	ecx, eax
jb	loc_45F890
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_45F999:				; CODE XREF: sub_45F870+110j
mov	eax, [esi+3Ch]
mov	edi, [esi+44h]
xor	ebp, ebp
test	eax, eax
jle	short loc_45F9DE
mov	ebx, [esp+10h+arg_10]
add	edi, 0Ch

loc_45F9AC:				; CODE XREF: sub_45F870+16Cj
mov	eax, [edi]
mov	edx, [esp+10h+arg_14]
mov	ecx, eax
imul	ecx, [esp+10h+arg_18]
imul	eax, [edx]
push	ecx
mov	ecx, [ebx]
push	eax
mov	eax, [edi+10h]
shl	eax, 3
push	eax
push	ecx
call	sub_45F9F0
mov	eax, [esi+3Ch]
add	esp, 10h
inc	ebp
add	ebx, 4
add	edi, 54h
cmp	ebp, eax
jl	short loc_45F9AC

loc_45F9DE:				; CODE XREF: sub_45F870+133j
mov	eax, [esp+10h+arg_14]
mov	edx, [esp+10h+arg_18]
mov	[eax], edx

loc_45F9E8:				; CODE XREF: sub_45F870+1Aj
					; sub_45F870+2Aj
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
sub_45F870 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45F9F0 proc	near			; CODE XREF: sub_45F870+A7p
					; sub_45F870+158p ...

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

push	ebp
mov	ebp, [esp+4+arg_C]
push	esi
mov	esi, [esp+8+arg_8]
cmp	esi, ebp
jge	short loc_45FA21
push	ebx
push	edi
mov	edi, [esp+10h+arg_0]
lea	ebx, [esi-1]

loc_45FA07:				; CODE XREF: sub_45F9F0+2Dj
mov	eax, [esp+10h+arg_4]
push	eax
push	1
push	esi
push	edi
push	ebx
push	edi
call	sub_45CD00
add	esp, 18h
inc	esi
cmp	esi, ebp
jl	short loc_45FA07
pop	edi
pop	ebx

loc_45FA21:				; CODE XREF: sub_45F9F0+Cj
pop	esi
pop	ebp
retn
sub_45F9F0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45FA30 proc	near			; DATA XREF: sub_45F770+46o

var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h
arg_14=	dword ptr  18h
arg_18=	dword ptr  1Ch

sub	esp, 0Ch
push	ebx
push	ebp
mov	ebx, [esp+14h+arg_14]
push	esi
mov	esi, [esp+18h+arg_0]
push	edi
mov	ecx, [ebx]
mov	eax, [esi+0ECh]
mov	edi, [esi+154h]
lea	eax, [eax+eax*2]
mov	[esp+1Ch+var_4], eax
mov	eax, [esp+1Ch+arg_18]
cmp	ecx, eax
jnb	loc_45FBF8

loc_45FA60:				; CODE XREF: sub_45FA30+1C2j
mov	edx, [esp+1Ch+arg_8]
mov	eax, [esp+1Ch+arg_C]
mov	edx, [edx]
cmp	edx, eax
jnb	loc_45FB38
mov	ecx, [edi+34h]
mov	ebp, [edi+3Ch]
sub	eax, edx
sub	ebp, ecx
cmp	ebp, eax
mov	[esp+1Ch+arg_0], ebp
jb	short loc_45FA8A
mov	[esp+1Ch+arg_0], eax
mov	ebp, eax

loc_45FA8A:				; CODE XREF: sub_45FA30+52j
mov	eax, [esi+160h]
push	ebp
push	ecx
mov	ecx, [esp+24h+arg_4]
lea	ebx, [edi+8]
lea	edx, [ecx+edx*4]
push	ebx
push	edx
push	esi
call	dword ptr [eax+4]
mov	eax, [edi+30h]
mov	ecx, [esi+20h]
add	esp, 14h
cmp	eax, ecx
jnz	short loc_45FB18
mov	eax, [esi+3Ch]
mov	[esp+1Ch+var_8], 0
test	eax, eax
jle	short loc_45FB18
mov	[esp+1Ch+var_C], ebx

loc_45FAC2:				; CODE XREF: sub_45FA30+E6j
mov	eax, [esi+0ECh]
mov	ebx, 1
cmp	eax, ebx
jl	short loc_45FAFD
or	ebp, 0FFFFFFFFh

loc_45FAD4:				; CODE XREF: sub_45FA30+C7j
mov	ecx, [esp+1Ch+var_C]
mov	edx, [esi+1Ch]
push	edx
push	1
mov	eax, [ecx]
push	ebp
push	eax
push	0
push	eax
call	sub_45CD00
mov	eax, [esi+0ECh]
add	esp, 18h
inc	ebx
dec	ebp
cmp	ebx, eax
jle	short loc_45FAD4
mov	ebp, [esp+1Ch+arg_0]

loc_45FAFD:				; CODE XREF: sub_45FA30+9Fj
mov	eax, [esp+1Ch+var_8]
mov	edx, [esp+1Ch+var_C]
mov	ecx, [esi+3Ch]
inc	eax
add	edx, 4
cmp	eax, ecx
mov	[esp+1Ch+var_8], eax
mov	[esp+1Ch+var_C], edx
jl	short loc_45FAC2

loc_45FB18:				; CODE XREF: sub_45FA30+7Dj
					; sub_45FA30+8Cj
mov	eax, [esp+1Ch+arg_8]
mov	ebx, [esp+1Ch+arg_14]
mov	edx, [eax]
add	edx, ebp
mov	[eax], edx
mov	ecx, [edi+34h]
mov	eax, [edi+30h]
add	ecx, ebp
sub	eax, ebp
mov	[edi+34h], ecx
mov	[edi+30h], eax
jmp	short loc_45FB85
; ---------------------------------------------------------------------------

loc_45FB38:				; CODE XREF: sub_45FA30+3Cj
mov	eax, [edi+30h]
test	eax, eax
jnz	loc_45FBF8
mov	eax, [edi+34h]
mov	ecx, [edi+3Ch]
cmp	eax, ecx
jge	short loc_45FB85
mov	eax, [esi+3Ch]
xor	ebp, ebp
test	eax, eax
jle	short loc_45FB7F
lea	ebx, [edi+8]

loc_45FB59:				; CODE XREF: sub_45FA30+149j
mov	ecx, [edi+3Ch]
mov	edx, [edi+34h]
mov	eax, [esi+1Ch]
push	ecx
mov	ecx, [ebx]
push	edx
push	eax
push	ecx
call	sub_45F9F0
mov	eax, [esi+3Ch]
add	esp, 10h
inc	ebp
add	ebx, 4
cmp	ebp, eax
jl	short loc_45FB59
mov	ebx, [esp+1Ch+arg_14]

loc_45FB7F:				; CODE XREF: sub_45FA30+124j
mov	edx, [edi+3Ch]
mov	[edi+34h], edx

loc_45FB85:				; CODE XREF: sub_45FA30+106j
					; sub_45FA30+11Bj
mov	eax, [edi+34h]
mov	ecx, [edi+3Ch]
cmp	eax, ecx
jnz	short loc_45FBEA
mov	edx, [ebx]
mov	eax, [esp+1Ch+arg_10]
mov	ecx, [esi+164h]
push	edx
mov	edx, [edi+38h]
push	eax
lea	eax, [edi+8]
push	edx
push	eax
push	esi
call	dword ptr [ecx+4]
mov	ebp, [ebx]
add	esp, 14h
mov	eax, [esp+1Ch+var_4]
inc	ebp
mov	[ebx], ebp
mov	ecx, [esi+0ECh]
mov	edx, [edi+38h]
add	edx, ecx
mov	ecx, edx
mov	[edi+38h], edx
cmp	ecx, eax
jl	short loc_45FBD0
mov	dword ptr [edi+38h], 0

loc_45FBD0:				; CODE XREF: sub_45FA30+197j
cmp	[edi+34h], eax
jl	short loc_45FBDC
mov	dword ptr [edi+34h], 0

loc_45FBDC:				; CODE XREF: sub_45FA30+1A3j
mov	edx, [esi+0ECh]
mov	eax, [edi+34h]
add	edx, eax
mov	[edi+3Ch], edx

loc_45FBEA:				; CODE XREF: sub_45FA30+15Dj
mov	eax, [esp+1Ch+arg_18]
mov	ecx, [ebx]
cmp	ecx, eax
jb	loc_45FA60

loc_45FBF8:				; CODE XREF: sub_45FA30+2Aj
					; sub_45FA30+10Dj
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
sub_45FA30 endp


; =============== S U B	R O U T	I N E =======================================


sub_45FC00 proc	near			; CODE XREF: sub_45F770+4Dp

var_18=	dword ptr -18h
var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4

sub	esp, 18h
push	ebx
push	ebp
mov	ebp, [esp+20h+arg_0]
push	edi
mov	ebx, [ebp+0ECh]
mov	eax, [ebp+3Ch]
imul	eax, ebx
mov	ecx, [ebp+4]
mov	edi, [ebp+154h]
lea	edx, [eax+eax*4]
shl	edx, 2
push	edx
push	1
push	ebp
call	dword ptr [ecx]
mov	ecx, [ebp+3Ch]
add	esp, 0Ch
mov	[esp+24h+arg_0], eax
mov	eax, [ebp+44h]
test	ecx, ecx
mov	[esp+24h+var_10], 0
jle	loc_45FD1D
push	esi
lea	esi, [ebx+ebx*2]
shl	esi, 2
lea	ecx, [eax+8]
add	edi, 8
mov	[esp+28h+var_8], esi
mov	[esp+28h+var_18], ecx
mov	[esp+28h+var_C], edi
jmp	short loc_45FC6B
; ---------------------------------------------------------------------------

loc_45FC63:				; CODE XREF: sub_45FC00+116j
mov	ecx, [esp+28h+var_18]
mov	esi, [esp+28h+var_8]

loc_45FC6B:				; CODE XREF: sub_45FC00+61j
lea	eax, [ebx+ebx*2]
mov	edi, [ebp+4]
push	eax
mov	eax, [ecx+14h]
imul	eax, [ebp+0E8h]
shl	eax, 3
cdq
idiv	dword ptr [ecx]
push	eax
push	1
push	ebp
call	dword ptr [edi+8]
mov	ecx, [esp+38h+arg_0]
add	esp, 10h
lea	edi, [ecx+ebx*4]
mov	ecx, esi
mov	edx, ecx
mov	esi, eax
shr	ecx, 2
mov	[esp+28h+var_4], edi
rep movsd
mov	ecx, edx
and	ecx, 3
test	ebx, ebx
rep movsb
jle	short loc_45FCDE
mov	esi, [esp+28h+arg_0]
mov	ecx, ebx
shl	ecx, 4
add	ecx, esi
lea	edx, [eax+ebx*8]
sub	esi, eax
mov	[esp+28h+var_14], ebx

loc_45FCC1:				; CODE XREF: sub_45FC00+DCj
mov	edi, [edx]
add	edx, 4
mov	[esi+eax], edi
mov	edi, [eax]
mov	[ecx], edi
mov	edi, [esp+28h+var_14]
add	eax, 4
add	ecx, 4
dec	edi
mov	[esp+28h+var_14], edi
jnz	short loc_45FCC1

loc_45FCDE:				; CODE XREF: sub_45FC00+ABj
mov	ecx, [esp+28h+var_C]
mov	eax, [esp+28h+var_4]
lea	edx, [ebx+ebx*4]
mov	[ecx], eax
mov	eax, [esp+28h+arg_0]
add	ecx, 4
lea	edx, [eax+edx*4]
mov	eax, [esp+28h+var_10]
mov	[esp+28h+arg_0], edx
mov	edx, [esp+28h+var_18]
mov	[esp+28h+var_C], ecx
mov	ecx, [ebp+3Ch]
inc	eax
add	edx, 54h
cmp	eax, ecx
mov	[esp+28h+var_10], eax
mov	[esp+28h+var_18], edx
jl	loc_45FC63
pop	esi

loc_45FD1D:				; CODE XREF: sub_45FC00+42j
pop	edi
pop	ebp
pop	ebx
add	esp, 18h
retn
sub_45FC00 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45FD30 proc	near			; CODE XREF: sub_459F80+21p

var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4

sub	esp, 8
push	ebp
push	esi
mov	esi, [esp+10h+arg_0]
push	edi
push	34h
push	1
mov	eax, [esi+4]
push	esi
mov	[esp+20h+var_8], 1
call	dword ptr [eax]
mov	ebp, eax
xor	edi, edi
mov	[esi+164h], ebp
add	esp, 0Ch
mov	dword ptr [ebp+0], offset nullsub_6
mov	dword ptr [ebp+4], offset sub_45FED0
mov	[ebp+8], edi
mov	eax, [esi+0BCh]
cmp	eax, edi
mov	[esp+14h+arg_0], ebp
jz	short loc_45FD89
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 19h
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4

loc_45FD89:				; CODE XREF: sub_45FD30+46j
mov	ecx, [esi+3Ch]
mov	eax, [esi+44h]
cmp	ecx, edi
mov	[esp+14h+var_4], edi
jle	loc_45FE86
push	ebx
lea	ebx, [eax+0Ch]
lea	edi, [ebp+0Ch]

loc_45FDA2:				; CODE XREF: sub_45FD30+14Fj
mov	ecx, [ebx-4]
mov	eax, [esi+0E8h]
cmp	ecx, eax
jnz	short loc_45FDE0
mov	edx, [ebx]
cmp	edx, [esi+0ECh]
jnz	short loc_45FDE0
mov	eax, [esi+0C0h]
test	eax, eax
jz	short loc_45FDD5
mov	dword ptr [edi], offset	sub_4605C0
mov	dword ptr [ebp+8], 1
jmp	loc_45FE6B
; ---------------------------------------------------------------------------

loc_45FDD5:				; CODE XREF: sub_45FD30+91j
mov	dword ptr [edi], offset	sub_4600F0
jmp	loc_45FE6B
; ---------------------------------------------------------------------------

loc_45FDE0:				; CODE XREF: sub_45FD30+7Dj
					; sub_45FD30+87j
lea	edx, [ecx+ecx]
cmp	edx, eax
jnz	short loc_45FE3A
mov	ebp, [ebx]
cmp	ebp, [esi+0ECh]
jnz	short loc_45FE05
mov	ebp, [esp+18h+arg_0]
mov	[esp+18h+var_8], 0
mov	dword ptr [edi], offset	sub_460140
jmp	short loc_45FE6B
; ---------------------------------------------------------------------------

loc_45FE05:				; CODE XREF: sub_45FD30+BFj
mov	ebp, [esp+18h+arg_0]
cmp	edx, eax
jnz	short loc_45FE3A
mov	edx, [ebx]
shl	edx, 1
cmp	edx, [esi+0ECh]
jnz	short loc_45FE3A
mov	eax, [esi+0C0h]
test	eax, eax
jz	short loc_45FE32
mov	dword ptr [edi], offset	sub_4602D0
mov	dword ptr [ebp+8], 1
jmp	short loc_45FE6B
; ---------------------------------------------------------------------------

loc_45FE32:				; CODE XREF: sub_45FD30+F1j
mov	dword ptr [edi], offset	sub_4601F0
jmp	short loc_45FE6B
; ---------------------------------------------------------------------------

loc_45FE3A:				; CODE XREF: sub_45FD30+B5j
					; sub_45FD30+DBj ...
cdq
idiv	ecx
test	edx, edx
jnz	short loc_45FE5A
mov	eax, [esi+0ECh]
cdq
idiv	dword ptr [ebx]
test	edx, edx
jnz	short loc_45FE5A
mov	[esp+18h+var_8], edx
mov	dword ptr [edi], offset	sub_45FF60
jmp	short loc_45FE6B
; ---------------------------------------------------------------------------

loc_45FE5A:				; CODE XREF: sub_45FD30+10Fj
					; sub_45FD30+11Cj
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 26h
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4

loc_45FE6B:				; CODE XREF: sub_45FD30+A0j
					; sub_45FD30+ABj ...
mov	eax, [esp+18h+var_4]
mov	ecx, [esi+3Ch]
inc	eax
add	edi, 4
add	ebx, 54h
cmp	eax, ecx
mov	[esp+18h+var_4], eax
jl	loc_45FDA2
pop	ebx

loc_45FE86:				; CODE XREF: sub_45FD30+65j
mov	eax, [esi+0C0h]
test	eax, eax
jz	short loc_45FEAC
mov	eax, [esp+14h+var_8]
test	eax, eax
jnz	short loc_45FEAC
mov	edx, [esi]
push	0
push	esi
mov	dword ptr [edx+14h], 63h
mov	eax, [esi]
call	dword ptr [eax+4]
add	esp, 8

loc_45FEAC:				; CODE XREF: sub_45FD30+15Ej
					; sub_45FD30+166j
pop	edi
pop	esi
pop	ebp
add	esp, 8
retn
sub_45FD30 endp

; ---------------------------------------------------------------------------
align 10h
; [00000001 BYTES: COLLAPSED FUNCTION nullsub_6. PRESS KEYPAD CTRL-"+" TO EXPAND]
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45FED0 proc	near			; DATA XREF: sub_45FD30+30o

var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h

push	ecx
push	ebx
mov	ebx, [esp+8+arg_0]
push	ebp
push	edi
mov	eax, [ebx+3Ch]
mov	ebp, [ebx+164h]
mov	edi, [ebx+44h]
mov	[esp+10h+arg_0], 0
test	eax, eax
jle	short loc_45FF51
mov	eax, [esp+10h+arg_8]
push	esi
mov	esi, [esp+14h+arg_4]
add	ebp, 0Ch
lea	ecx, ds:0[eax*4]
mov	eax, [esp+14h+arg_C]
sub	eax, esi
mov	[esp+14h+var_4], ecx
mov	[esp+14h+arg_8], eax
jmp	short loc_45FF17
; ---------------------------------------------------------------------------

loc_45FF13:				; CODE XREF: sub_45FED0+7Ej
mov	eax, [esp+14h+arg_8]

loc_45FF17:				; CODE XREF: sub_45FED0+41j
mov	edx, [edi+0Ch]
mov	eax, [eax+esi]
imul	edx, [esp+14h+arg_10]
lea	ecx, [eax+edx*4]
mov	edx, [esi]
push	ecx
mov	ecx, [esp+18h+var_4]
add	edx, ecx
push	edx
push	edi
push	ebx
call	dword ptr [ebp+0]
mov	eax, [esp+24h+arg_0]
mov	ecx, [ebx+3Ch]
add	esp, 10h
inc	eax
add	esi, 4
add	ebp, 4
add	edi, 54h
cmp	eax, ecx
mov	[esp+14h+arg_0], eax
jl	short loc_45FF13
pop	esi

loc_45FF51:				; CODE XREF: sub_45FED0+1Ej
pop	edi
pop	ebp
pop	ebx
pop	ecx
retn
sub_45FED0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_45FF60 proc	near			; DATA XREF: sub_45FD30+122o

var_1C=	dword ptr -1Ch
var_18=	dword ptr -18h
var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

sub	esp, 1Ch
mov	ecx, [esp+1Ch+arg_0]
push	ebx
mov	ebx, [esp+20h+arg_4]
push	ebp
mov	eax, [ecx+0E8h]
push	esi
cdq
idiv	dword ptr [ebx+8]
push	edi
mov	edi, [ecx+0ECh]
mov	ebp, [ebx+1Ch]
mov	ecx, [ecx+1Ch]
shl	ebp, 3
mov	[esp+2Ch+var_4], ebp
mov	esi, eax
mov	eax, edi
cdq
idiv	dword ptr [ebx+0Ch]
mov	[esp+2Ch+var_14], eax
imul	eax, esi
mov	[esp+2Ch+var_8], eax
cdq
sub	eax, edx
sar	eax, 1
mov	[esp+2Ch+var_C], eax
mov	eax, esi
imul	eax, ebp
push	eax
push	ecx
push	edi
mov	edi, [esp+38h+arg_8]
push	edi
call	sub_460090
mov	eax, [ebx+0Ch]
add	esp, 10h
test	eax, eax
mov	[esp+2Ch+var_10], 0
jle	loc_460084
mov	edx, [esp+2Ch+arg_C]
mov	[esp+2Ch+arg_0], edi
mov	[esp+2Ch+arg_8], edx

loc_45FFDC:				; CODE XREF: sub_45FF60+11Ej
mov	eax, [esp+2Ch+arg_8]
xor	ebx, ebx
test	ebp, ebp
mov	ecx, [eax]
mov	[esp+2Ch+var_1C], ecx
jbe	short loc_46004C
mov	[esp+2Ch+var_18], ebp

loc_45FFF0:				; CODE XREF: sub_45FF60+E6j
mov	eax, [esp+2Ch+var_14]
xor	ebp, ebp
test	eax, eax
jle	short loc_460024
mov	edi, [esp+2Ch+arg_0]
mov	[esp+2Ch+arg_C], eax

loc_460002:				; CODE XREF: sub_45FF60+C2j
mov	eax, [edi]
add	eax, ebx
test	esi, esi
jle	short loc_460016
mov	ecx, esi

loc_46000C:				; CODE XREF: sub_45FF60+B4j
xor	edx, edx
mov	dl, [eax]
add	ebp, edx
inc	eax
dec	ecx
jnz	short loc_46000C

loc_460016:				; CODE XREF: sub_45FF60+A8j
mov	eax, [esp+2Ch+arg_C]
add	edi, 4
dec	eax
mov	[esp+2Ch+arg_C], eax
jnz	short loc_460002

loc_460024:				; CODE XREF: sub_45FF60+98j
mov	eax, [esp+2Ch+var_C]
mov	ecx, [esp+2Ch+var_1C]
add	eax, ebp
add	ebx, esi
cdq
idiv	[esp+2Ch+var_8]
inc	ecx
mov	[esp+2Ch+var_1C], ecx
mov	[ecx-1], al
mov	eax, [esp+2Ch+var_18]
dec	eax
mov	[esp+2Ch+var_18], eax
jnz	short loc_45FFF0
mov	ebp, [esp+2Ch+var_4]

loc_46004C:				; CODE XREF: sub_45FF60+8Aj
mov	ecx, [esp+2Ch+var_14]
mov	edx, [esp+2Ch+arg_8]
mov	ebx, [esp+2Ch+arg_0]
add	edx, 4
lea	eax, ds:0[ecx*4]
mov	[esp+2Ch+arg_8], edx
mov	edx, [esp+2Ch+arg_4]
add	ebx, eax
mov	eax, [esp+2Ch+var_10]
mov	[esp+2Ch+arg_0], ebx
mov	ecx, [edx+0Ch]
inc	eax
cmp	eax, ecx
mov	[esp+2Ch+var_10], eax
jl	loc_45FFDC

loc_460084:				; CODE XREF: sub_45FF60+6Aj
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 1Ch
retn
sub_45FF60 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_460090 proc	near			; CODE XREF: sub_45FF60+55p
					; sub_4600F0+3Bp ...

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

mov	ecx, [esp+arg_8]
push	ebp
mov	ebp, [esp+4+arg_C]
sub	ebp, ecx
test	ebp, ebp
jle	short loc_4600EA
mov	eax, [esp+4+arg_4]
test	eax, eax
jle	short loc_4600EA
push	ebx
push	esi
mov	esi, [esp+0Ch+arg_0]
push	edi
mov	[esp+10h+arg_C], eax

loc_4600B2:				; CODE XREF: sub_460090+55j
mov	edi, [esp+10h+arg_8]
mov	eax, [esi]
add	edi, eax
mov	ecx, ebp
mov	edx, ecx
add	esi, 4
mov	al, [edi-1]
mov	bl, al
mov	bh, bl
mov	eax, ebx
shl	eax, 10h
mov	ax, bx
shr	ecx, 2
rep stosd
mov	ecx, edx
and	ecx, 3
rep stosb
mov	eax, [esp+10h+arg_C]
dec	eax
mov	[esp+10h+arg_C], eax
jnz	short loc_4600B2
pop	edi
pop	esi
pop	ebx

loc_4600EA:				; CODE XREF: sub_460090+Dj
					; sub_460090+15j
pop	ebp
retn
sub_460090 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_4600F0 proc	near			; DATA XREF: sub_45FD30:loc_45FDD5o

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

push	esi
mov	esi, [esp+4+arg_0]
mov	edx, [esp+4+arg_8]
push	edi
mov	eax, [esi+1Ch]
mov	ecx, [esi+0ECh]
mov	edi, [esp+8+arg_C]
push	eax
push	ecx
push	0
push	edi
push	0
push	edx
call	sub_45CD00
mov	eax, [esp+20h+arg_4]
mov	edx, [esi+1Ch]
mov	ecx, [eax+1Ch]
mov	eax, [esi+0ECh]
shl	ecx, 3
push	ecx
push	edx
push	eax
push	edi
call	sub_460090
add	esp, 28h
pop	edi
pop	esi
retn
sub_4600F0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_460140 proc	near			; DATA XREF: sub_45FD30+CDo

var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

push	ecx
push	ebp
mov	ebp, [esp+8+arg_4]
push	esi
push	edi
mov	edi, [ebp+1Ch]
mov	esi, [esp+10h+arg_8]
shl	edi, 3
mov	[esp+10h+var_4], edi
lea	eax, [edi+edi]
push	eax
mov	eax, [esp+14h+arg_0]
mov	ecx, [eax+1Ch]
mov	edx, [eax+0ECh]
push	ecx
push	edx
push	esi
call	sub_460090
mov	eax, [ebp+0Ch]
add	esp, 10h
test	eax, eax
mov	[esp+10h+arg_0], 0
jle	short loc_4601E2
push	ebx
mov	ebx, [esp+14h+arg_C]
mov	edx, esi
sub	ebx, esi
mov	[esp+14h+arg_8], edx
mov	[esp+14h+arg_C], ebx

loc_460192:				; CODE XREF: sub_460140+9Fj
mov	ecx, [ebx+edx]
mov	eax, [edx]
xor	esi, esi
test	edi, edi
jbe	short loc_4601CA

loc_46019D:				; CODE XREF: sub_460140+78j
xor	edx, edx
xor	ebx, ebx
mov	dl, [eax+1]
mov	bl, [eax]
mov	ebp, esi
xor	esi, 1
add	ebp, edx
add	eax, 2
add	ebx, ebp
sar	ebx, 1
mov	[ecx], bl
inc	ecx
dec	edi
jnz	short loc_46019D
mov	edi, [esp+14h+var_4]
mov	ebp, [esp+14h+arg_4]
mov	edx, [esp+14h+arg_8]
mov	ebx, [esp+14h+arg_C]

loc_4601CA:				; CODE XREF: sub_460140+5Bj
mov	eax, [esp+14h+arg_0]
mov	ecx, [ebp+0Ch]
inc	eax
add	edx, 4
cmp	eax, ecx
mov	[esp+14h+arg_0], eax
mov	[esp+14h+arg_8], edx
jl	short loc_460192
pop	ebx

loc_4601E2:				; CODE XREF: sub_460140+3Fj
pop	edi
pop	esi
pop	ebp
pop	ecx
retn
sub_460140 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_4601F0 proc	near			; DATA XREF: sub_45FD30:loc_45FE32o

var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

sub	esp, 0Ch
push	ebx
push	ebp
mov	ebp, [esp+14h+arg_4]
push	esi
mov	esi, [esp+18h+arg_8]
mov	ebx, [ebp+1Ch]
shl	ebx, 3
mov	[esp+18h+var_4], ebx
lea	eax, [ebx+ebx]
push	eax
mov	eax, [esp+1Ch+arg_0]
mov	ecx, [eax+1Ch]
mov	edx, [eax+0ECh]
push	ecx
push	edx
push	esi
call	sub_460090
mov	eax, [ebp+0Ch]
add	esp, 10h
test	eax, eax
mov	[esp+18h+var_8], 0
jle	loc_4602C3
mov	eax, [esp+18h+arg_C]
mov	edx, esi
push	edi
mov	[esp+1Ch+var_C], edx
mov	[esp+1Ch+arg_0], eax

loc_460246:				; CODE XREF: sub_4601F0+D0j
mov	ecx, [esp+1Ch+arg_0]
mov	eax, [edx]
test	ebx, ebx
mov	esi, [ecx]
mov	ecx, [edx+4]
mov	edi, 1
jbe	short loc_4602A0
mov	[esp+1Ch+arg_8], ebx

loc_46025E:				; CODE XREF: sub_4601F0+A2j
xor	edx, edx
xor	ebx, ebx
mov	dl, [ecx+1]
mov	bl, [eax+1]
mov	ebp, edx
xor	edx, edx
mov	dl, [eax]
add	ebp, ebx
xor	ebx, ebx
add	eax, 2
mov	bl, [ecx]
add	ecx, 2
add	ebx, edi
xor	edi, 3
add	ebx, ebp
add	edx, ebx
sar	edx, 2
mov	[esi], dl
mov	edx, [esp+1Ch+arg_8]
inc	esi
dec	edx
mov	[esp+1Ch+arg_8], edx
jnz	short loc_46025E
mov	ebx, [esp+1Ch+var_4]
mov	ebp, [esp+1Ch+arg_4]
mov	edx, [esp+1Ch+var_C]

loc_4602A0:				; CODE XREF: sub_4601F0+68j
mov	eax, [esp+1Ch+var_8]
mov	esi, [esp+1Ch+arg_0]
mov	ecx, [ebp+0Ch]
add	edx, 8
inc	eax
add	esi, 4
cmp	eax, ecx
mov	[esp+1Ch+var_C], edx
mov	[esp+1Ch+var_8], eax
mov	[esp+1Ch+arg_0], esi
jl	short loc_460246
pop	edi

loc_4602C3:				; CODE XREF: sub_4601F0+41j
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
sub_4601F0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_4602D0 proc	near			; DATA XREF: sub_45FD30+F3o

var_2C=	dword ptr -2Ch
var_28=	dword ptr -28h
var_24=	dword ptr -24h
var_20=	dword ptr -20h
var_1C=	dword ptr -1Ch
var_18=	dword ptr -18h
var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

sub	esp, 2Ch
mov	eax, [esp+2Ch+arg_8]
push	ebx
push	ebp
mov	ebp, [esp+34h+arg_4]
push	esi
push	edi
mov	esi, [ebp+1Ch]
mov	edi, [esp+3Ch+arg_0]
shl	esi, 3
mov	edx, [edi+1Ch]
lea	ebx, [eax-4]
mov	eax, [edi+0ECh]
lea	ecx, [esi+esi]
push	ecx
add	eax, 2
push	edx
push	eax
push	ebx
call	sub_460090
mov	eax, [edi+0C0h]
add	esp, 10h
mov	[esp+3Ch+var_14], 0
lea	ecx, [eax+eax*4]
shl	ecx, 4
shl	eax, 4
mov	edx, ecx
mov	ecx, 4000h
mov	[esp+3Ch+arg_0], eax
mov	eax, [ebp+0Ch]
sub	ecx, edx
test	eax, eax
mov	[esp+3Ch+var_2C], ecx
jle	loc_4605B1
mov	eax, [esp+3Ch+arg_C]
add	esi, 0FFFFFFFEh
mov	[esp+3Ch+arg_C], eax
mov	eax, ebx
mov	[esp+3Ch+var_4], esi
mov	[esp+3Ch+var_18], eax

loc_46034F:				; CODE XREF: sub_4602D0+2DBj
mov	ecx, [esp+3Ch+arg_C]
mov	ebx, [eax+4]
mov	edi, [eax]
mov	ebp, [eax+0Ch]
mov	edx, [ecx]
lea	ecx, [ebx+2]
mov	[esp+3Ch+var_20], ecx
xor	ecx, ecx
mov	cl, [edi]
mov	esi, [eax+8]
mov	[esp+3Ch+var_10], ecx
lea	ecx, [ebp+2]
mov	[esp+3Ch+var_C], ecx
lea	ecx, [edi+2]
mov	[esp+3Ch+var_1C], ecx
mov	[esp+3Ch+arg_8], edx
xor	ecx, ecx
xor	edx, edx
mov	cl, [ebp+1]
mov	dl, [ebp+0]
mov	ebp, ecx
xor	ecx, ecx
mov	cl, [edi+1]
mov	edi, [esp+3Ch+var_20]
mov	[esp+3Ch+var_28], edx
xor	edx, edx
mov	dl, [esi]
add	ebp, ecx
xor	ecx, ecx
mov	[esp+3Ch+var_24], edx
mov	cl, [edi]
xor	edx, edx
mov	dl, [ebx]
mov	edi, ecx
lea	eax, [esi+2]
add	edi, edx
xor	ecx, ecx
add	edi, ebp
mov	cl, [eax]
mov	ebp, [esp+3Ch+var_28]
add	ecx, edi
mov	edi, [esp+3Ch+var_24]
add	ecx, edi
mov	edi, [esp+3Ch+var_10]
add	ecx, edi
mov	[esp+3Ch+var_8], eax
add	ecx, ebp
mov	ebp, [esp+3Ch+var_1C]
xor	eax, eax
mov	al, [ebp+0]
mov	ebp, eax
xor	eax, eax
add	ebp, edi
mov	edi, [esp+3Ch+var_C]
mov	al, [edi]
lea	ecx, [ebp+ecx*2+0]
add	eax, ecx
xor	ecx, ecx
mov	cl, [esi+1]
mov	ebp, [esp+3Ch+var_28]
mov	esi, ecx
xor	ecx, ecx
mov	cl, [ebx+1]
add	edx, esi
add	ecx, edx
mov	edx, [esp+3Ch+var_24]
add	eax, ebp
add	ecx, edx
imul	eax, [esp+3Ch+arg_0]
imul	ecx, [esp+3Ch+var_2C]
lea	edx, [eax+ecx+8000h]
mov	eax, [esp+3Ch+arg_8]
mov	ecx, [esp+3Ch+var_8]
mov	esi, [esp+3Ch+var_1C]
sar	edx, 10h
mov	[eax], dl
mov	edx, [esp+3Ch+var_4]
inc	eax
mov	[esp+3Ch+arg_8], eax
mov	eax, [esp+3Ch+var_20]
test	edx, edx
jbe	loc_4604E6
mov	[esp+3Ch+var_1C], edx

loc_460443:				; CODE XREF: sub_4602D0+210j
xor	edx, edx
xor	ebx, ebx
mov	dl, [edi+1]
mov	bl, [esi+1]
add	edx, ebx
xor	ebx, ebx
mov	bl, [ecx-1]
add	eax, 2
add	edx, ebx
xor	ebx, ebx
mov	bl, [eax-3]
add	ecx, 2
add	edx, ebx
xor	ebx, ebx
mov	bl, [edi]
add	esi, 2
add	edx, ebx
xor	ebx, ebx
mov	bl, [esi-2]
add	edi, 2
add	edx, ebx
xor	ebx, ebx
mov	bl, [eax]
add	edx, ebx
xor	ebx, ebx
mov	bl, [ecx]
add	edx, ebx
xor	ebx, ebx
mov	bl, [edi-3]
lea	ebp, [ebx+edx*2]
xor	ebx, ebx
mov	bl, [esi-3]
xor	edx, edx
add	ebp, ebx
xor	ebx, ebx
mov	bl, [esi]
mov	dl, [eax-1]
add	ebp, ebx
xor	ebx, ebx
mov	bl, [edi]
add	ebp, ebx
xor	ebx, ebx
mov	bl, [ecx-1]
imul	ebp, [esp+3Ch+arg_0]
add	ebx, edx
xor	edx, edx
mov	dl, [ecx-2]
add	ebx, edx
xor	edx, edx
mov	dl, [eax-2]
add	ebx, edx
imul	ebx, [esp+3Ch+var_2C]
lea	edx, [ebx+ebp+8000h]
mov	ebp, [esp+3Ch+arg_8]
sar	edx, 10h
mov	[ebp+0], dl
mov	edx, [esp+3Ch+var_1C]
inc	ebp
dec	edx
mov	[esp+3Ch+arg_8], ebp
mov	[esp+3Ch+var_1C], edx
jnz	loc_460443

loc_4604E6:				; CODE XREF: sub_4602D0+169j
xor	edx, edx
xor	ebx, ebx
mov	dl, [edi+1]
mov	bl, [eax-1]
mov	[esp+3Ch+var_C], edx
xor	edx, edx
mov	dl, [esi+1]
mov	[esp+3Ch+var_1C], edx
xor	edx, edx
mov	dl, [ecx+1]
mov	[esp+3Ch+var_20], edx
xor	edx, edx
mov	dl, [eax+1]
mov	ebp, edx
xor	edx, edx
mov	dl, [ecx-1]
mov	[esp+3Ch+var_10], ebp
add	edx, ebx
xor	ebx, ebx
mov	bl, [edi]
add	ebx, ebp
mov	ebp, edx
xor	edx, edx
add	ebx, ebp
mov	dl, [esi]
mov	ebp, [esp+3Ch+var_1C]
add	edx, ebx
mov	ebx, [esp+3Ch+var_20]
add	edx, ebx
xor	ebx, ebx
mov	bl, [edi-1]
add	edx, ebp
mov	ebp, [esp+3Ch+var_C]
mov	edi, ebx
mov	ebx, [esp+3Ch+var_1C]
add	edx, ebp
add	edi, ebx
xor	ebx, ebx
mov	bl, [esi-1]
lea	edx, [edi+edx*2]
mov	edi, [esp+3Ch+arg_C]
add	ebx, edx
xor	edx, edx
mov	dl, [ecx]
xor	ecx, ecx
mov	cl, [eax]
mov	eax, [esp+3Ch+var_10]
add	eax, edx
add	ebx, ebp
imul	ebx, [esp+3Ch+arg_0]
add	ecx, eax
mov	eax, [esp+3Ch+var_20]
add	ecx, eax
mov	eax, [esp+3Ch+arg_8]
imul	ecx, [esp+3Ch+var_2C]
add	edi, 4
lea	edx, [ebx+ecx+8000h]
mov	ecx, [esp+3Ch+var_18]
sar	edx, 10h
mov	[eax], dl
mov	edx, [esp+3Ch+arg_4]
lea	eax, [ecx+8]
mov	ecx, [esp+3Ch+var_14]
mov	esi, [edx+0Ch]
inc	ecx
cmp	ecx, esi
mov	[esp+3Ch+var_18], eax
mov	[esp+3Ch+var_14], ecx
mov	[esp+3Ch+arg_C], edi
jl	loc_46034F

loc_4605B1:				; CODE XREF: sub_4602D0+64j
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 2Ch
retn
sub_4602D0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_4605C0 proc	near			; DATA XREF: sub_45FD30+93o

var_18=	dword ptr -18h
var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

sub	esp, 18h
push	ebx
mov	ebx, [esp+1Ch+arg_4]
push	ebp
mov	ebp, [esp+20h+arg_8]
push	esi
mov	esi, [ebx+1Ch]
push	edi
mov	edi, [esp+28h+arg_0]
shl	esi, 3
mov	ecx, [edi+0ECh]
mov	eax, [edi+1Ch]
push	esi
add	ecx, 2
push	eax
lea	edx, [ebp-4]
push	ecx
push	edx
call	sub_460090
mov	eax, [edi+0C0h]
mov	ecx, 80h
sub	ecx, eax
add	esp, 10h
shl	eax, 6
mov	[esp+28h+var_18], eax
mov	eax, [ebx+0Ch]
shl	ecx, 9
test	eax, eax
mov	[esp+28h+var_14], ecx
mov	[esp+28h+var_C], 0
jle	loc_460757
mov	eax, [esp+28h+arg_C]
add	esi, 0FFFFFFFEh
mov	[esp+28h+arg_C], eax
lea	eax, [ebp+4]
mov	[esp+28h+var_4], esi
mov	[esp+28h+var_8], eax

loc_460638:				; CODE XREF: sub_4605C0+191j
mov	ecx, [esp+28h+arg_C]
mov	edi, [eax-8]
mov	ebp, [eax]
mov	edx, [ecx]
mov	ecx, [eax-4]
mov	[esp+28h+arg_8], edx
xor	eax, eax
mov	al, [ecx]
xor	edx, edx
mov	dl, [ebp+0]
mov	esi, eax
mov	eax, edx
xor	edx, edx
mov	dl, [edi]
mov	ebx, esi
add	ebx, eax
xor	eax, eax
mov	al, [ebp+1]
add	edx, ebx
inc	ebp
inc	edi
xor	ebx, ebx
inc	ecx
mov	bl, [edi]
mov	[esp+28h+arg_0], edx
add	eax, ebx
xor	ebx, ebx
mov	bl, [ecx]
add	edx, edx
add	eax, ebx
sub	edx, esi
imul	esi, [esp+28h+var_14]
add	edx, eax
mov	ebx, [esp+28h+var_4]
imul	edx, [esp+28h+var_18]
lea	edx, [edx+esi+8000h]
mov	esi, [esp+28h+arg_8]
sar	edx, 10h
mov	[esi], dl
mov	edx, [esp+28h+arg_0]
inc	esi
mov	[esp+28h+arg_0], eax
test	ebx, ebx
mov	[esp+28h+arg_8], esi
jbe	short loc_460707
mov	[esp+28h+var_10], ebx

loc_4606B2:				; CODE XREF: sub_4605C0+145j
xor	eax, eax
xor	ebx, ebx
mov	al, [ecx]
mov	bl, [edi+1]
inc	ecx
inc	edi
mov	esi, eax
inc	ebp
xor	eax, eax
sub	edx, esi
mov	al, [ebp+0]
imul	esi, [esp+28h+var_14]
add	eax, ebx
xor	ebx, ebx
mov	bl, [ecx]
add	eax, ebx
mov	ebx, [esp+28h+arg_0]
add	edx, eax
mov	[esp+28h+arg_0], eax
add	edx, ebx
imul	edx, [esp+28h+var_18]
lea	edx, [edx+esi+8000h]
mov	esi, [esp+28h+arg_8]
sar	edx, 10h
mov	[esi], dl
mov	edx, ebx
mov	ebx, [esp+28h+var_10]
inc	esi
dec	ebx
mov	[esp+28h+arg_8], esi
mov	[esp+28h+var_10], ebx
jnz	short loc_4606B2

loc_460707:				; CODE XREF: sub_4605C0+ECj
xor	ebx, ebx
add	eax, eax
mov	bl, [ecx]
mov	ecx, ebx
mov	ebx, [esp+28h+arg_C]
sub	eax, ecx
imul	ecx, [esp+28h+var_14]
add	eax, edx
mov	edx, [esp+28h+arg_4]
imul	eax, [esp+28h+var_18]
add	ebx, 4
lea	ecx, [eax+ecx+8000h]
mov	eax, [esp+28h+var_8]
sar	ecx, 10h
mov	[esi], cl
mov	ecx, [esp+28h+var_C]
mov	esi, [edx+0Ch]
inc	ecx
add	eax, 4
cmp	ecx, esi
mov	[esp+28h+var_C], ecx
mov	[esp+28h+arg_C], ebx
mov	[esp+28h+var_8], eax
jl	loc_460638

loc_460757:				; CODE XREF: sub_4605C0+5Cj
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 18h
retn
sub_4605C0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_460760 proc	near			; CODE XREF: sub_459F80+1Bp

arg_0= dword ptr  4

push	ebx
push	esi
mov	esi, [esp+8+arg_0]
push	edi
push	0Ch
push	1
mov	eax, [esi+4]
push	esi
call	dword ptr [eax]
mov	edi, eax
add	esp, 0Ch
mov	[esi+160h], edi
mov	ebx, 4
mov	dword ptr [edi], offset	nullsub_7
mov	eax, [esi+28h]
dec	eax
cmp	eax, ebx			; switch 5 cases
ja	short loc_4607C9		; jumptable 0046078F default case
jmp	ds:off_460970[eax*4]		; switch jump
; ---------------------------------------------------------------------------

loc_460796:				; CODE XREF: sub_460760+2Fj
					; DATA XREF: .text:off_460970o
cmp	dword ptr [esi+24h], 1		; jumptable 0046078F case 0
jz	short loc_4607E0
jmp	short loc_4607CF
; ---------------------------------------------------------------------------

loc_46079E:				; CODE XREF: sub_460760+2Fj
					; DATA XREF: .text:off_460970o
cmp	dword ptr [esi+24h], 3		; jumptable 0046078F cases 1,2
jz	short loc_4607E0
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 9
mov	ecx, [esi]
call	dword ptr [ecx]
jmp	short loc_4607DD
; ---------------------------------------------------------------------------

loc_4607B4:				; CODE XREF: sub_460760+2Fj
					; DATA XREF: .text:off_460970o
cmp	[esi+24h], ebx			; jumptable 0046078F cases 3,4
jz	short loc_4607E0
mov	edx, [esi]
push	esi
mov	dword ptr [edx+14h], 9
mov	eax, [esi]
call	dword ptr [eax]
jmp	short loc_4607DD
; ---------------------------------------------------------------------------

loc_4607C9:				; CODE XREF: sub_460760+2Dj
cmp	dword ptr [esi+24h], 1		; jumptable 0046078F default case
jge	short loc_4607E0

loc_4607CF:				; CODE XREF: sub_460760+3Cj
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 9
mov	edx, [esi]
call	dword ptr [edx]

loc_4607DD:				; CODE XREF: sub_460760+52j
					; sub_460760+67j
add	esp, 4

loc_4607E0:				; CODE XREF: sub_460760+3Aj
					; sub_460760+42j ...
mov	eax, [esi+40h]
lea	ecx, [eax-1]
cmp	ecx, ebx			; switch 5 cases
ja	loc_460945			; jumptable 004607EE default case
jmp	ds:off_460984[ecx*4]		; switch jump
; ---------------------------------------------------------------------------

loc_4607F5:				; CODE XREF: sub_460760+8Ej
					; DATA XREF: .text:off_460984o
cmp	dword ptr [esi+3Ch], 1		; jumptable 004607EE case 0
jz	short loc_46080C
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 0Ah
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4

loc_46080C:				; CODE XREF: sub_460760+99j
mov	eax, [esi+28h]
cmp	eax, 1
jnz	short loc_46081F
mov	dword ptr [edi+4], offset sub_460DD0
pop	edi
pop	esi
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_46081F:				; CODE XREF: sub_460760+B2j
cmp	eax, 2
jnz	short loc_460835
mov	dword ptr [edi], offset	sub_4609A0
mov	dword ptr [edi+4], offset sub_460BB0
pop	edi
pop	esi
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_460835:				; CODE XREF: sub_460760+C2j
cmp	eax, 3
jnz	loc_4608E8
mov	dword ptr [edi+4], offset sub_460DD0
pop	edi
pop	esi
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_460849:				; CODE XREF: sub_460760+8Ej
					; DATA XREF: .text:off_460984o
cmp	dword ptr [esi+3Ch], 3		; jumptable 004607EE case 1
jz	short loc_460860
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 0Ah
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4

loc_460860:				; CODE XREF: sub_460760+EDj
cmp	dword ptr [esi+28h], 2
jz	loc_460965
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 1Bh
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4
pop	edi
pop	esi
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_46087F:				; CODE XREF: sub_460760+8Ej
					; DATA XREF: .text:off_460984o
cmp	dword ptr [esi+3Ch], 3		; jumptable 004607EE case 2
jz	short loc_460896
mov	edx, [esi]
push	esi
mov	dword ptr [edx+14h], 0Ah
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4

loc_460896:				; CODE XREF: sub_460760+123j
mov	eax, [esi+28h]
cmp	eax, 2
jnz	short loc_4608AF
mov	dword ptr [edi], offset	sub_4609A0
mov	dword ptr [edi+4], offset sub_460A80
pop	edi
pop	esi
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_4608AF:				; CODE XREF: sub_460760+13Cj
cmp	eax, 3
jz	loc_460965
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 1Bh
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4
pop	edi
pop	esi
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_4608CD:				; CODE XREF: sub_460760+8Ej
					; DATA XREF: .text:off_460984o
cmp	[esi+3Ch], ebx			; jumptable 004607EE case 3
jz	short loc_4608E3
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 0Ah
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4

loc_4608E3:				; CODE XREF: sub_460760+170j
cmp	[esi+28h], ebx
jz	short loc_460965

loc_4608E8:				; CODE XREF: sub_460760+D8j
mov	edx, [esi]
push	esi
mov	dword ptr [edx+14h], 1Bh
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4
pop	edi
pop	esi
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_4608FD:				; CODE XREF: sub_460760+8Ej
					; DATA XREF: .text:off_460984o
cmp	[esi+3Ch], ebx			; jumptable 004607EE case 4
jz	short loc_460913
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 0Ah
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4

loc_460913:				; CODE XREF: sub_460760+1A0j
mov	eax, [esi+28h]
cmp	eax, ebx
jnz	short loc_46092B
mov	dword ptr [edi], offset	sub_4609A0
mov	dword ptr [edi+4], offset sub_460C60
pop	edi
pop	esi
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_46092B:				; CODE XREF: sub_460760+1B8j
cmp	eax, 5
jz	short loc_460965
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 1Bh
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4
pop	edi
pop	esi
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_460945:				; CODE XREF: sub_460760+88j
cmp	eax, [esi+28h]			; jumptable 004607EE default case
jnz	short loc_460954
mov	edx, [esi+3Ch]
mov	eax, [esi+24h]
cmp	edx, eax
jz	short loc_460965

loc_460954:				; CODE XREF: sub_460760+1E8j
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 1Bh
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4

loc_460965:				; CODE XREF: sub_460760+104j
					; sub_460760+152j ...
mov	dword ptr [edi+4], offset loc_460E40
pop	edi
pop	esi
pop	ebx
retn
align 4
; ---------------------------------------------------------------------------
off_460970 dd offset loc_460796		; DATA XREF: sub_460760+2Fr
dd offset loc_46079E			; jump table for switch	statement
dd offset loc_46079E
dd offset loc_4607B4
dd offset loc_4607B4
off_460984 dd offset loc_4607F5		; DATA XREF: sub_460760+8Er
dd offset loc_460849			; jump table for switch	statement
dd offset loc_46087F
dd offset loc_4608CD
dd offset loc_4608FD
sub_460760 endp

align 10h

; =============== S U B	R O U T	I N E =======================================


sub_4609A0 proc	near			; DATA XREF: sub_460760+C4o
					; sub_460760+13Eo ...

var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4

sub	esp, 8
mov	eax, [esp+8+arg_0]
push	ebx
push	ebp
push	esi
mov	ecx, [eax+4]
mov	esi, [eax+160h]
push	edi
push	2000h
push	1
push	eax
call	dword ptr [ecx]
mov	[esi+8], eax
xor	edx, edx
add	esp, 0Ch
xor	ebx, ebx
xor	edi, edi
xor	esi, esi
mov	[esp+18h+var_4], edx
mov	[esp+18h+var_8], edx
mov	[esp+18h+arg_0], offset	byte_807FFF
mov	ecx, 8000h
add	eax, 800h

loc_4609E6:				; CODE XREF: sub_4609A0+CFj
mov	ebp, [esp+18h+arg_0]
mov	[eax-800h], edx
mov	[eax-400h], esi
mov	[eax], ecx
mov	[eax+400h], edi
mov	[eax+800h], ebx
mov	[eax+0C00h], ebp
mov	ebp, [esp+18h+var_8]
mov	[eax+1000h], ebp
mov	ebp, [esp+18h+var_4]
mov	[eax+1400h], ebp
mov	ebp, [esp+18h+arg_0]
add	ebp, 8000h
add	ecx, 1D2Fh
mov	[esp+18h+arg_0], ebp
mov	ebp, [esp+18h+var_8]
sub	ebp, 6B2Fh
add	edx, 4C8Bh
mov	[esp+18h+var_8], ebp
mov	ebp, [esp+18h+var_4]
add	eax, 4
add	esi, 9646h
sub	edi, 2B33h
sub	ebx, 54CDh
sub	ebp, 14D1h
cmp	ecx, 1D91D1h
mov	[esp+18h+var_4], ebp
jle	loc_4609E6
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 8
retn
sub_4609A0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_460A80 proc	near			; DATA XREF: sub_460760+144o

var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h

sub	esp, 10h
mov	ecx, [esp+10h+arg_0]
mov	eax, [ecx+160h]
mov	ecx, [ecx+1Ch]
mov	[esp+10h+var_10], ecx
mov	ecx, [esp+10h+arg_10]
mov	eax, [eax+8]
dec	ecx
js	loc_460BA3
mov	edx, [esp+10h+arg_C]
push	ebx
push	ebp
push	esi
shl	edx, 2
inc	ecx
push	edi
mov	edi, [esp+20h+arg_8]
mov	[esp+20h+arg_10], ecx

loc_460AB6:				; CODE XREF: sub_460A80+119j
mov	ecx, [esp+20h+arg_4]
mov	ebp, [edi+8]
mov	esi, [ecx]
mov	ebp, [edx+ebp]
add	ecx, 4
mov	[esp+20h+arg_0], ebp
mov	[esp+20h+arg_4], ecx
mov	ecx, [edi]
mov	ebp, [esp+20h+var_10]
mov	ebx, [edx+ecx]
mov	ecx, [edi+4]
mov	ecx, [edx+ecx]
add	edx, 4
test	ebp, ebp
mov	[esp+20h+var_4], edx
jbe	loc_460B90
mov	edx, [esp+20h+arg_0]
sub	ebx, ecx
sub	edx, ecx
mov	[esp+20h+arg_C], ebx
mov	[esp+20h+var_8], edx
mov	[esp+20h+arg_0], ebp

loc_460AFF:				; CODE XREF: sub_460A80+102j
xor	edx, edx
mov	dl, [esi]
add	esi, 3
mov	edi, edx
xor	edx, edx
mov	dl, [esi-2]
mov	ebp, edx
xor	edx, edx
mov	dl, [esi-1]
mov	ebx, [eax+ebp*4+400h]
mov	[esp+20h+var_C], edx
mov	edx, [eax+edx*4+800h]
add	edx, ebx
mov	ebx, [eax+edi*4]
add	edx, ebx
mov	ebx, [esp+20h+arg_C]
sar	edx, 10h
mov	[ebx+ecx], dl
mov	edx, [esp+20h+var_C]
mov	ebx, [eax+edx*4+1400h]
add	ebx, [eax+ebp*4+1000h]
add	ebx, [eax+edi*4+0C00h]
sar	ebx, 10h
mov	[ecx], bl
mov	edx, [eax+edx*4+1C00h]
mov	ebx, [eax+ebp*4+1800h]
mov	ebp, [eax+edi*4+1400h]
mov	edi, [esp+20h+var_8]
add	edx, ebx
add	edx, ebp
sar	edx, 10h
mov	[edi+ecx], dl
mov	edx, [esp+20h+arg_0]
inc	ecx
dec	edx
mov	[esp+20h+arg_0], edx
jnz	loc_460AFF
mov	edi, [esp+20h+arg_8]
mov	edx, [esp+20h+var_4]

loc_460B90:				; CODE XREF: sub_460A80+65j
mov	ecx, [esp+20h+arg_10]
dec	ecx
mov	[esp+20h+arg_10], ecx
jnz	loc_460AB6
pop	edi
pop	esi
pop	ebp
pop	ebx

loc_460BA3:				; CODE XREF: sub_460A80+1Cj
add	esp, 10h
retn
sub_460A80 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_460BB0 proc	near			; DATA XREF: sub_460760+CAo

var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h

push	ecx
mov	eax, [esp+4+arg_0]
push	esi
mov	ecx, [eax+160h]
mov	edx, [eax+1Ch]
mov	eax, [esp+8+arg_10]
mov	[esp+8+var_4], edx
mov	esi, [ecx+8]
dec	eax
js	loc_460C5B
mov	ecx, [esp+8+arg_C]
push	ebx
push	ebp
inc	eax
push	edi
lea	edi, ds:0[ecx*4]
mov	[esp+14h+arg_0], eax

loc_460BE4:				; CODE XREF: sub_460BB0+A6j
mov	ecx, [esp+14h+arg_4]
add	edi, 4
mov	[esp+14h+arg_C], edi
mov	eax, [ecx]
add	ecx, 4
mov	[esp+14h+arg_4], ecx
mov	ecx, [esp+14h+arg_8]
mov	ecx, [ecx]
mov	ecx, [ecx+edi-4]
mov	[esp+14h+arg_10], ecx
xor	ecx, ecx
test	edx, edx
jbe	short loc_460C4D

loc_460C0C:				; CODE XREF: sub_460BB0+97j
xor	edx, edx
mov	dl, [eax]
add	eax, 3
mov	edi, edx
xor	edx, edx
mov	dl, [eax-2]
mov	ebp, edx
xor	edx, edx
mov	dl, [eax-1]
mov	ebx, [esi+ebp*4+400h]
mov	ebp, [esi+edi*4]
mov	edx, [esi+edx*4+800h]
mov	edi, [esp+14h+arg_10]
add	edx, ebx
add	edx, ebp
sar	edx, 10h
mov	[ecx+edi], dl
mov	edx, [esp+14h+var_4]
inc	ecx
cmp	ecx, edx
jb	short loc_460C0C
mov	edi, [esp+14h+arg_C]

loc_460C4D:				; CODE XREF: sub_460BB0+5Aj
mov	eax, [esp+14h+arg_0]
dec	eax
mov	[esp+14h+arg_0], eax
jnz	short loc_460BE4
pop	edi
pop	ebp
pop	ebx

loc_460C5B:				; CODE XREF: sub_460BB0+1Bj
pop	esi
pop	ecx
retn
sub_460BB0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_460C60 proc	near			; DATA XREF: sub_460760+1C0o

var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h

sub	esp, 14h
mov	ecx, [esp+14h+arg_0]
mov	edx, [esp+14h+arg_10]
dec	edx
mov	eax, [ecx+160h]
mov	ecx, [ecx+1Ch]
mov	[esp+14h+var_14], ecx
mov	eax, [eax+8]
js	loc_460DC3
mov	ecx, [esp+14h+arg_C]
push	ebx
shl	ecx, 2
push	ebp
inc	edx
push	esi
mov	esi, [esp+20h+arg_8]
push	edi
mov	[esp+24h+arg_C], edx

loc_460C96:				; CODE XREF: sub_460C60+159j
mov	edi, [esp+24h+arg_4]
mov	ebx, [esi+8]
mov	edx, [edi]
mov	ebx, [ebx+ecx]
add	edi, 4
mov	[esp+24h+var_10], ebx
mov	ebx, [esi+0Ch]
mov	[esp+24h+arg_4], edi
mov	edi, [esi]
mov	[esp+24h+arg_0], edx
mov	ebx, [ecx+ebx]
mov	ebp, [ecx+edi]
mov	edi, [esi+4]
mov	[esp+24h+arg_10], ebx
mov	ebx, [esp+24h+var_14]
mov	edi, [ecx+edi]
add	ecx, 4
test	ebx, ebx
mov	[esp+24h+var_4], ecx
jbe	loc_460DB0
mov	ecx, [esp+24h+arg_10]
sub	edi, ebp
sub	ecx, ebp
mov	[esp+24h+var_8], edi
mov	[esp+24h+var_C], ecx
mov	ecx, [esp+24h+var_10]
sub	ecx, ebp
mov	[esp+24h+arg_10], ebx
mov	[esp+24h+var_10], ecx
jmp	short loc_460CFD
; ---------------------------------------------------------------------------

loc_460CF9:				; CODE XREF: sub_460C60+142j
mov	edx, [esp+24h+arg_0]

loc_460CFD:				; CODE XREF: sub_460C60+97j
xor	ecx, ecx
xor	ebx, ebx
mov	cl, [edx]
mov	bl, [edx+1]
mov	esi, ecx
mov	ecx, 0FFh
sub	ecx, esi
mov	esi, 0FFh
sub	esi, ebx
xor	ebx, ebx
mov	bl, [edx+2]
mov	dl, [edx+3]
mov	edi, 0FFh
sub	edi, ebx
mov	ebx, [esp+24h+var_C]
mov	[ebx+ebp], dl
mov	edx, [esp+24h+arg_0]
mov	ebx, [eax+esi*4+400h]
add	edx, 4
mov	[esp+24h+arg_0], edx
mov	edx, [eax+edi*4+800h]
add	edx, ebx
mov	ebx, [eax+ecx*4]
add	edx, ebx
sar	edx, 10h
mov	[ebp+0], dl
mov	edx, [eax+edi*4+1400h]
mov	ebx, [eax+esi*4+1000h]
add	edx, ebx
mov	ebx, [eax+ecx*4+0C00h]
add	edx, ebx
mov	ebx, [esp+24h+var_8]
sar	edx, 10h
mov	[ebx+ebp], dl
mov	edx, [eax+edi*4+1C00h]
mov	ebx, [eax+esi*4+1800h]
mov	edi, [eax+ecx*4+1400h]
mov	ecx, [esp+24h+var_10]
add	edx, ebx
add	edx, edi
sar	edx, 10h
mov	[ecx+ebp], dl
mov	ecx, [esp+24h+arg_10]
inc	ebp
dec	ecx
mov	[esp+24h+arg_10], ecx
jnz	loc_460CF9
mov	esi, [esp+24h+arg_8]
mov	ecx, [esp+24h+var_4]

loc_460DB0:				; CODE XREF: sub_460C60+73j
mov	edx, [esp+24h+arg_C]
dec	edx
mov	[esp+24h+arg_C], edx
jnz	loc_460C96
pop	edi
pop	esi
pop	ebp
pop	ebx

loc_460DC3:				; CODE XREF: sub_460C60+1Cj
add	esp, 14h
retn
sub_460C60 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_460DD0 proc	near			; DATA XREF: sub_460760+B4o
					; sub_460760+DEo

var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h

push	ecx
mov	eax, [esp+4+arg_0]
push	edi
mov	edi, [eax+1Ch]
mov	eax, [eax+24h]
mov	[esp+8+var_4], eax
mov	eax, [esp+8+arg_10]
dec	eax
js	short loc_460E34
mov	ecx, [esp+8+arg_C]
mov	edx, [esp+8+arg_4]
push	ebx
inc	eax
push	ebp
push	esi
lea	ebp, ds:0[ecx*4]
mov	[esp+14h+arg_0], eax

loc_460DFE:				; CODE XREF: sub_460DD0+5Fj
mov	eax, [esp+14h+arg_8]
mov	ecx, [edx]
add	edx, 4
add	ebp, 4
mov	eax, [eax]
mov	esi, [eax+ebp-4]
xor	eax, eax
test	edi, edi
jbe	short loc_460E26

loc_460E16:				; CODE XREF: sub_460DD0+54j
mov	bl, [ecx]
mov	[eax+esi], bl
mov	ebx, [esp+14h+var_4]
add	ecx, ebx
inc	eax
cmp	eax, edi
jb	short loc_460E16

loc_460E26:				; CODE XREF: sub_460DD0+44j
mov	eax, [esp+14h+arg_0]
dec	eax
mov	[esp+14h+arg_0], eax
jnz	short loc_460DFE
pop	esi
pop	ebp
pop	ebx

loc_460E34:				; CODE XREF: sub_460DD0+15j
pop	edi
pop	ecx
retn
sub_460DD0 endp

; ---------------------------------------------------------------------------
align 10h

loc_460E40:				; DATA XREF: sub_460760:loc_460965o
mov	eax, [esp+4]
push	ebp
push	edi
mov	ebp, [eax+3Ch]
mov	edi, [eax+1Ch]
mov	eax, [esp+1Ch]
dec	eax
js	short loc_460ED0
mov	ecx, [esp+18h]
inc	eax
push	ebx
push	esi
lea	edx, ds:0[ecx*4]
mov	[esp+20h], eax
mov	[esp+14h], edx

loc_460E69:				; CODE XREF: .text:00460ECCj
xor	ebx, ebx
test	ebp, ebp
mov	[esp+24h], ebx
jle	short loc_460EAA
mov	edx, [esp+1Ch]

loc_460E77:				; CODE XREF: .text:00460EA8j
mov	eax, [esp+18h]
mov	esi, [esp+14h]
mov	ecx, [eax]
mov	eax, [edx]
mov	esi, [eax+esi]
xor	eax, eax
test	edi, edi
jbe	short loc_460E9E
add	ecx, ebx

loc_460E8E:				; CODE XREF: .text:00460E98j
mov	bl, [ecx]
add	ecx, ebp
mov	[eax+esi], bl
inc	eax
cmp	eax, edi
jb	short loc_460E8E
mov	ebx, [esp+24h]

loc_460E9E:				; CODE XREF: .text:00460E8Aj
inc	ebx
add	edx, 4
cmp	ebx, ebp
mov	[esp+24h], ebx
jl	short loc_460E77

loc_460EAA:				; CODE XREF: .text:00460E71j
mov	edx, [esp+18h]
mov	ecx, [esp+14h]
mov	eax, 4
add	edx, eax
add	ecx, eax
mov	eax, [esp+20h]
mov	[esp+18h], edx
dec	eax
mov	[esp+14h], ecx
mov	[esp+20h], eax
jnz	short loc_460E69
pop	esi
pop	ebx

loc_460ED0:				; CODE XREF: .text:00460E51j
pop	edi
pop	ebp
retn
; ---------------------------------------------------------------------------
align 10h
; [00000001 BYTES: COLLAPSED FUNCTION nullsub_7. PRESS KEYPAD CTRL-"+" TO EXPAND]
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_460EF0 proc	near			; CODE XREF: sub_459F80+8p

arg_0= dword ptr  4
arg_4= dword ptr  8

push	ebx
push	esi
mov	esi, [esp+8+arg_0]
push	edi
push	24h
push	1
mov	eax, [esi+4]
push	esi
call	dword ptr [eax]
mov	edi, eax
xor	ebx, ebx
mov	[esi+14Ch], edi
push	esi
mov	dword ptr [edi], offset	sub_461520
mov	dword ptr [edi+4], offset sub_4619B0
mov	dword ptr [edi+8], offset sub_4619E0
mov	[edi+10h], ebx
call	sub_460FB0
mov	eax, [esi+0ACh]
add	esp, 10h
cmp	eax, ebx
jz	short loc_460F40
push	esi
call	sub_461180
add	esp, 4
jmp	short loc_460F50
; ---------------------------------------------------------------------------

loc_460F40:				; CODE XREF: sub_460EF0+43j
mov	[esi+0E4h], ebx
mov	dword ptr [esi+0A8h], 1

loc_460F50:				; CODE XREF: sub_460EF0+4Ej
cmp	[esi+0E4h], ebx
jz	short loc_460F62
mov	dword ptr [esi+0B8h], 1

loc_460F62:				; CODE XREF: sub_460EF0+66j
cmp	[esp+0Ch+arg_4], ebx
jz	short loc_460F82
cmp	[esi+0B8h], ebx
jz	short loc_460F79
mov	dword ptr [edi+14h], 1
jmp	short loc_460F85
; ---------------------------------------------------------------------------

loc_460F79:				; CODE XREF: sub_460EF0+7Ej
mov	dword ptr [edi+14h], 2
jmp	short loc_460F85
; ---------------------------------------------------------------------------

loc_460F82:				; CODE XREF: sub_460EF0+76j
mov	[edi+14h], ebx

loc_460F85:				; CODE XREF: sub_460EF0+87j
					; sub_460EF0+90j
mov	[edi+20h], ebx
mov	[edi+18h], ebx
cmp	[esi+0B8h], ebx
jz	short loc_460FA2
mov	ecx, [esi+0A8h]
shl	ecx, 1
mov	[edi+1Ch], ecx
pop	edi
pop	esi
pop	ebx
retn
; ---------------------------------------------------------------------------

loc_460FA2:				; CODE XREF: sub_460EF0+A1j
mov	edx, [esi+0A8h]
mov	[edi+1Ch], edx
pop	edi
pop	esi
pop	ebx
retn
sub_460EF0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_460FB0 proc	near			; CODE XREF: sub_460EF0+33p

arg_0= dword ptr  4

push	ebx
push	ebp
push	esi
mov	esi, [esp+0Ch+arg_0]
push	edi
mov	eax, [esi+20h]
test	eax, eax
jbe	short loc_460FD4
mov	eax, [esi+1Ch]
test	eax, eax
jbe	short loc_460FD4
mov	eax, [esi+3Ch]
test	eax, eax
jle	short loc_460FD4
mov	eax, [esi+24h]
test	eax, eax
jg	short loc_460FE5

loc_460FD4:				; CODE XREF: sub_460FB0+Dj
					; sub_460FB0+14j ...
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 20h
mov	ecx, [esi]
call	dword ptr [ecx]
add	esp, 4

loc_460FE5:				; CODE XREF: sub_460FB0+22j
mov	ecx, [esi+20h]
mov	eax, 0FFDCh
cmp	ecx, eax
jg	short loc_460FF6
cmp	[esi+1Ch], eax
jle	short loc_46100C

loc_460FF6:				; CODE XREF: sub_460FB0+3Fj
mov	edx, [esi]
push	esi
mov	dword ptr [edx+14h], 29h
mov	ecx, [esi]
mov	[ecx+18h], eax
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4

loc_46100C:				; CODE XREF: sub_460FB0+44j
cmp	dword ptr [esi+38h], 8
jz	short loc_46102B
mov	eax, [esi]
push	esi
mov	dword ptr [eax+14h], 0Fh
mov	ecx, [esi]
mov	edx, [esi+38h]
mov	[ecx+18h], edx
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4

loc_46102B:				; CODE XREF: sub_460FB0+60j
mov	ecx, [esi+3Ch]
mov	eax, 0Ah
cmp	ecx, eax
jle	short loc_461055
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 1Ah
mov	edx, [esi]
mov	ecx, [esi+3Ch]
mov	[edx+18h], ecx
mov	edx, [esi]
mov	[edx+1Ch], eax
mov	eax, [esi]
call	dword ptr [eax]
add	esp, 4

loc_461055:				; CODE XREF: sub_460FB0+85j
mov	ecx, [esi+3Ch]
mov	eax, [esi+44h]
mov	ebp, 1
xor	ebx, ebx
test	ecx, ecx
mov	[esi+0E8h], ebp
mov	[esi+0ECh], ebp
jle	short loc_4610D1
lea	edi, [eax+0Ch]

loc_461075:				; CODE XREF: sub_460FB0+11Fj
mov	eax, [edi-4]
test	eax, eax
jle	short loc_46108C
cmp	eax, 4
jg	short loc_46108C
mov	eax, [edi]
test	eax, eax
jle	short loc_46108C
cmp	eax, 4
jle	short loc_46109D

loc_46108C:				; CODE XREF: sub_460FB0+CAj
					; sub_460FB0+CFj ...
mov	ecx, [esi]
push	esi
mov	dword ptr [ecx+14h], 12h
mov	edx, [esi]
call	dword ptr [edx]
add	esp, 4

loc_46109D:				; CODE XREF: sub_460FB0+DAj
mov	eax, [esi+0E8h]
mov	ecx, [edi-4]
cmp	eax, ecx
jg	short loc_4610AC
mov	eax, ecx

loc_4610AC:				; CODE XREF: sub_460FB0+F8j
mov	[esi+0E8h], eax
mov	eax, [esi+0ECh]
mov	ecx, [edi]
cmp	eax, ecx
jg	short loc_4610C0
mov	eax, ecx

loc_4610C0:				; CODE XREF: sub_460FB0+10Cj
mov	[esi+0ECh], eax
mov	eax, [esi+3Ch]
inc	ebx
add	edi, 54h
cmp	ebx, eax
jl	short loc_461075

loc_4610D1:				; CODE XREF: sub_460FB0+C0j
mov	ecx, [esi+3Ch]
mov	eax, [esi+44h]
xor	ebx, ebx
test	ecx, ecx
jle	short loc_46115C
lea	edi, [eax+24h]

loc_4610E0:				; CODE XREF: sub_460FB0+1AAj
mov	ecx, [edi-1Ch]
mov	[edi-20h], ebx
mov	dword ptr [edi], 8
imul	ecx, [esi+1Ch]
mov	eax, [esi+0E8h]
shl	eax, 3
push	eax
push	ecx
call	sub_45CCD0
mov	[edi-8], eax
mov	eax, [edi-18h]
imul	eax, [esi+20h]
mov	edx, [esi+0ECh]
shl	edx, 3
push	edx
push	eax
call	sub_45CCD0
mov	edx, [edi-1Ch]
mov	[edi-4], eax
imul	edx, [esi+1Ch]
mov	ecx, [esi+0E8h]
push	ecx
push	edx
call	sub_45CCD0
mov	ecx, [edi-18h]
mov	[edi+4], eax
imul	ecx, [esi+20h]
mov	eax, [esi+0ECh]
push	eax
push	ecx
call	sub_45CCD0
add	esp, 20h
mov	[edi+8], eax
mov	[edi+0Ch], ebp
mov	eax, [esi+3Ch]
inc	ebx
add	edi, 54h
cmp	ebx, eax
jl	short loc_4610E0

loc_46115C:				; CODE XREF: sub_460FB0+12Bj
mov	edx, [esi+0ECh]
mov	eax, [esi+20h]
shl	edx, 3
push	edx
push	eax
call	sub_45CCD0
add	esp, 8
mov	[esi+0F0h], eax
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
sub_460FB0 endp

end